Allocate memory given certain requirements
Source position: exec.pas line 1846
function execAllocMem( |
byteSize: Cardinal; |
requirements: Cardinal |
):Pointer; |
byteSize |
|
The size of the desired block in bytes. (The operating system will automatically round this number to a multiple of the system memory chunk size) |
requirements |
|
If no flags are set, the system will return the best available memory block. (MEMF_*) |
A pointer to the newly allocated memory block. If there are no free memory regions large enough to satisfy the request, nil will be returned. The pointer must be checked for nil before the memory block may be used!
This is the memory allocator to be used by system code and applications. It provides a means of specifying that the allocation should be made in a memory area accessible to the chips, or accessible to shared system code.
Memory is allocated based on requirements and options. Any "requirement" must be met by a memory allocation, any "option" will be applied to the block regardless. AllocMem will try all memory spaces until one is found with the proper requirements and room for the memory request.
>If the free list is corrupt, the system will panic with alert AN_MemCorrupt, $01000005.
This function may not be called from interrupts.
A DOS process will have its pr_Result2 field set to ERROR_NO_FREE_STORE if the memory allocation fails.
|
Free a memory block with given size |
|
|
Allocate memory and keep track of the size |