[fpc-pascal] replacement of MARK and RELEASE function in free pascal

Karoly Balogh (Charlie/SGR) charlie at scenergy.dfmk.hu
Thu Jun 19 13:29:11 CEST 2014


Hi,

On Thu, 19 Jun 2014, mokashe.ram wrote:

> Ok thanks,
>
>    but using untyped pointer how to mention size in GETMEM()?
>
> *      GETMEM(markexam,'' ....");*

It's detailed in the documentation, it's detailed there along with the
rest of the memory management functions, please refer to that:

http://www.freepascal.org/docs-html/rtl/system/getmem.html

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));

This changed little since the times of Turbo Pascal, works the same way.

Charlie



More information about the fpc-pascal mailing list