News for hackers. Stuff that matters.
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.
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)
Re:Once upon a time, memory allocators made sense by fanf2 on Tuesday January 26, 2016 @04:36AM (#10972599)
Yes. I had not previously noticed this. What a disaster.