Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pfacka
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
Mach7: (OCaml Like) Pattern Matching for C++
(github.com)
3 points
by
pfacka
12y ago
|
0 comments
2.
▲
by
pfacka
13y ago
Noted, thanks, failed allocation is definitely good candidate for fail fast scenario.
3.
▲
by
pfacka
13y ago
That is because to my knowledge we does not have something like "crealloc" to grow allocated memory effectively. Naive implementation of such function will lead always to coping memory from old to new area and effective would far
4.
▲
by
pfacka
13y ago
True, but return type of free() is void, thus it says nothing about return value. The POSIX says: "If size is 0, either a null pointer or a unique pointer that can be successfully passed to free() shall be returned."
5.
▲
by
pfacka
13y ago
Thanks, I tested with GCC and Clang on Linux on 64-bit x86, GCC+OpenBSD on 32-bit+x86 and GCC+Linux on PowerPC 603. The point I was aiming for is that described operation is indeed undefined.
6.
▲
by
pfacka
13y ago
It seems that I have totally messed up whole vector example by last minute changes. The check was meant to illustrate what eliteraspberrie described in previous comment.
7.
▲
by
pfacka
13y ago
I agree that wording is bit unclear. I will try to find better one, thanks.
8.
▲
by
pfacka
13y ago
Thanks, for pointing out
9.
▲
by
pfacka
13y ago
Yep, that is definitely error
10.
▲
by
pfacka
13y ago
The challenging part is to get details of using them correctly and avoid security and portability issues and I consider it neccesaty introduction for section dealing with memory management.
11.
▲
by
pfacka
13y ago
I see, but could you please provide better alternative? I couldn't find anything more alive and representative than Boehm GC.
12.
▲
Guide to Advanced Programming in C
(pfacka.binaryparadise.com)
168 points
by
pfacka
13y ago
|
74 comments
13.
▲
Just-in-time compilers for number crunching in Python
(phi-node.com)
1 points
by
pfacka
13y ago
|
0 comments