Re:Once upon a time, memory allocators made sense
by carussell on Monday January 18, 2016 @02:59PM
(#10926512)
I'm still not clear on this. What does "allocating zero bytes" mean, if not "free the original allocation"? Keep the malloc metadata structures around but update their size to 0?
[ Parent
| on HN ]
Re:Once upon a time, memory allocators made sense
by cperciva on Monday January 18, 2016 @03:09PM
(#10926573)
Some systems handle a zero-byte allocation request by allocating a unique non-NULL pointer which cannot be dereferenced. If they run out of unique pointers, they can fail to allocate zero bytes.