SetPtrSize
SetPtrSize
Shrink or expand a nonrelocatable memory block Ptr thePtr ; address of a nonrelocatable memory block Size newSize ; desired size (a 32-bit value) SetPtrSize expands or shrinks the size of a nonrelocatable memory block. thePtr is the address of a nonrelocatable memory block; i.e., the value
obtained from a prior call to NewPtr. newSize is the desired size of the block. It should be less than 16M (a
24-bit value).
memFullErr (-108) No room in heap
memWZErr (-111) Illegal operation on a free block
Notes: Requests to shrink a block will always succeed, but may eventually lead to
heap fragmentation.
A request to grow a nonrelocatable block will frequently fail. If any new
nonrelocatable block is allocated after thePtr, it will probably be directly
above the storage for thePtr, and therefore, thePtr's data area cannot be
expanded. Always test for an error via MemError, e.g.: . . . the call failed . . .
}