4 ms·
> realloc(ptr, 0) is free I didn't know that so I went to read up on that. Turns out, this is true for C90, but apparently implementation-defined in C99 [1].
by adsche 13y ago
> realloc(ptr, 0) is free
I didn't know that so I went to read up on that. Turns out, this is true for C90, but apparently implementation-defined in C99 [1].
(But as the library creator you could of course define the behaviour that the provided function must have.)
[1] http://www.cplusplus.com/reference/cstdlib/realloc/ http://www.cplusplus.com/reference/cstdlib/realloc/