Re:Once upon a time, memory allocators made sense
by fanf2 on Monday January 18, 2016 @07:25PM
(#10928061)
A standards-conforming realloc will never try to allocate 0 bytes: it is required to free in that case.
[ Parent
| on HN ]
Re:Once upon a time, memory allocators made sense
by cperciva on Monday January 18, 2016 @07:50PM
(#10928149)
Alas, C11 seems to have bungled this.
Re:Once upon a time, memory allocators made sense
by masklinn on Tuesday January 19, 2016 @06:01AM
(#10929906)
The change appeared in C99 apparently, in my ISO/IEC 9899:1999 PDF the part about a 0-sized realloc being equivalent to a free has already been removed, and that a 0-sized allocation can return either a NULL or a non-null pointer has appeared under implementation-defined behaviours (j.3.12)