JCL Help: SHReallocMem Function
- Project summary
Search in JCL HelpSearch in all projects
Reallocates (changes the size) a block of memory in the shell's memory space. The contents of the block prior to reallocation are reserved but there is no guarantee that the pointer will retain its value. The newly allocated block may be on a different address if there is not enough room to expand it in place. Also the actual size of the allocated block maybe slightly larger then the requested size because of additional maintenance data (not accessible).
function SHReallocMem(var P: Pointer; Count: Integer): Boolean;
|var P: Pointer||On input pointer to a memory block previously allocated with either SHGetMem SHAllocMem or nil. In the latter case SHReallocMem functions just like SHGetMem.|
|Count: Integer||Total size, in bytes, to (re)allocate. If 0 then the memory pointed to be P (if not nil) is freed.|
If the function succeeds it returns True and P contains the address of the reallocated memory block. If the function fails it returns False, and P will retain its value.
SHReallocMem reallocates a specified memory block to a new size using the shell's memory allocator. If on input P is not nil then it must point to a block of memory previously allocated with the shell's memory allocator (SHGetMem or SHAllocMem).
Marcel van Brakel
Contribute to this help topic
This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page