HP Pascal/iX Programmer's Guide (31502-90023)

6- 12
specified size and alignment. If it succeeds, it "points" its VAR
pointer parameter at the first element of the region and assigns its VAR
Boolean parameter the value
true
. If it fails, it assigns its VAR
Boolean parameter the value
false
.
Syntax
p_getheap (VAR
regptr
: localanyptr;
regsize
: integer;
alignment
: integer;
VAR
ok
: Boolean);
Parameters
regptr
If
p_getheap
can allocate the region of heap space, it
"points"
regptr
at the first element of the region (that
is,
p_getheap
assigns the address of the first element of
the region to
regptr
).
regsize
The size of the region of heap space, in bytes.
alignment
Integer: Specifies the region of heap space to be:
1 Byte-aligned
2 Halfword-aligned
4 Word-aligned
8 Double-word-aligned
16 16-byte aligned
32 32-byte aligned
64 64-byte aligned
2048 Page-aligned
ok
If
p_getheap
can allocate the region of heap space, it
assigns
ok
the value
true
; if not, it assigns
ok
the value
false
.
The procedure
p_rtnheap
tries to deallocate a region of heap space that
the
p_getheap
procedure allocated. If it succeeds, it assigns its VAR
Boolean parameter the value
true
. If it fails, it assigns its VAR
Boolean parameter the value
false
.
P_rtnheap
does not close files
residing in the region allocated by
p_getheap
.
Syntax
p_rtnheap (VAR
regptr
: localanyptr;
regsize
: integer;
alignment
: integer;
VAR
ok
: Boolean);
Parameters
regptr
A pointer whose current value was assigned to it by
the procedure
p_getheap
.
regsize
The size in bytes of the region of heap space that
p_getheap
assigned to
regptr
.
alignment
The number that specified the alignment of the
region of heap space that
p_getheap
assigned to
regptr
.
ok
If
p_rtnheap
can deallocate the region of heap
space, it assigns
ok
the value
true
; if not, it
assigns
ok
the value
false
.
Example 1
$STANDARD_LEVEL 'HP_MODCAL'$
PROGRAM prog;
TYPE