[fpc-devel] GetMem(SomePointer, 0) <> nil

Marc Weustink marc.weustink at cuperus.nl
Tue Mar 1 16:17:26 CET 2011


Hans-Peter Diettrich wrote:
> Paul Ishenin schrieb:
>
>> I noticed today that if I want to allocate 0 bytes I get not a nil but
>> a valid pointer. Why?
>
> This will allow for a following Realloc.

Since the resulting pointer of a realloc isn't guarantied the same as 
the source pointer, I don't see a problem in reallocing nil.

Marc



More information about the fpc-devel mailing list