On 19.06.2014 13:29, Karoly Balogh (Charlie/SGR) wrote:
So either you use mypointer:=GetMem(size); or GetMem(mypointer, size); both are valid. If you need to allocate heap space for a record, use New/Dispose, or GetMem(myptr, sizeof(Tmyrecord));
I wouldn't use GetMem() in case of record pointers just in case a managed type happens to be in there. Unlike GetMem() New() does initialize those fields correctly. Alternatively one should use Initialize(myptr^) after the call to GetMem().
Regards, Sven _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal