GRAB (bytes)



GRAB is a function which reserves a specified amount of space in the common heap area of memory for use and returns the start address of the allocated area.


With GRAB (unlike ALCHP), reserved memory can only be given back to QDOS for other purposes with RELEASE. It is necessary to know the start address returned by GRAB to do this, so a formula like SCRBASE GRAB(32768) wastes 32k of RAM if SCRBASE is used again. Although GRAB is comparable to RESPR in this respect, it will work with jobs in memory just like ALCHP. See also RESERVE. The amount of available memory can be found by using FREE or FREE_MEM.