HP Pascal/iX Programmer's Guide (31502-90023)
6- 14
p_getheap(ptr1,4,4,b); {allocate a 4-byte region}
(
Example continued on next page
.)
release(ptr2);
ptr1^ := 0; {The 4-byte region was not
deallocated, and the values
in it are still accessible}
p1^ := p2^ + p3^; {illegal -- p1, p2, and p3 were deallocated}
END.
Getheap and Rtnheap Procedures
The procedures
getheap
and
rtnheap
are intrinsics in the Pascal run-time
library. They are provided only for compatibility with existing source
code that was written for the MPE V operating system and only exists on
MPE/iX. If you are writing a new program, use the predefined procedures
p_getheap
and
p_rtnheap
instead.
The procedure
getheap
allocates a region of heap space, and the procedure
rtnheap
deallocates the region.
Syntax
getheap (VAR
regptr
: localanyptr;
VAR
regsize
: shortint;
VAR
ok
: shortint);
rtnheap (VAR
regptr
: localanyptr;
regsize
: shortint;
VAR
ok
: shortint);