JCL Help: GuardAllocMem Function
- Project summary
Search in JCL HelpSearch in all projects
Allocates a specified amount of memory and associates it with a safeguard.
function GuardAllocMem(Size: Cardinal; out SafeGuard: ISafeGuard): Pointer;
|Size: Cardinal||Size, in bytes, of the memory to allocate. This memory is allocated using the standard AllocMem function and as such is initialized to all zeros.|
|out SafeGuard: ISafeGuard||Receives a pointer to the ISafeGuard interface which is associated with the allocated memory.|
Pointer to the block of allocated memory.
GuardGetMem allocates the specified amount of memory and associates it with a safeguard. This function is identical to GuardGetMem except that the function uses AllocMem internally, as opposed to GetMem. As such the allocated memory is initialized with all zeros. A pointer to the allocated memory is returned as the function result. By using GuardGetMem you ensure that no matter how the scope in which the memory is allocated is left (e.g. by an exception or explicit Exit), the memory will be freed. See Guard for a more detailed description.
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