[fpc-devel] an observation about GetMem
Jonas Maebe
jonas.maebe at elis.ugent.be
Sat Sep 6 12:25:19 CEST 2008
On 05 Sep 2008, at 17:25, Peter Popov wrote:
>> In FPC it is done by design. If 0 bytes are asked we allocate at
>> least the minimum alignment to
>> get a valid pointer. This is done for compatibility with TP7.0 that
>> returns the value of heapptr
>> which is also a valid pointer.
>
> Thanks for the clarification!
> I guess if you switch to reallocmem entirely, there will be delphi
> compatibility, yes?
reallocmem indeed frees the memory and sets the pointer to nil if you
specify "0" as the memory size.
Jonas
More information about the fpc-devel
mailing list