[fpc-devel] an observation about GetMem

Micha Nelissen micha at neli.hopto.org
Fri Sep 5 09:34:18 CEST 2008


Peter Popov wrote:
> Well, if it points to something, then there is space, isn't it? Unless 
> it is clearly mentioned in the documentation that GetMem(p,0) results in 

You get a pointer to some place where you may store 0 bytes, so nothing :-).

This can be useful because otherwise you may think the allocation failed 
if you get nil back. (And you've disabled heap exception).

Micha



More information about the fpc-devel mailing list