Allocate memory and keep track of the size
Source position: exec.pas line 1325
function AllocVec( |
ByteSize: LongWord; |
Requirements: LongWord |
):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. For expanded systems, the fast memory pool is searched first. (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 zero before the memory block may be used!
Allocate a memory block and record its size, FreeVec() knows how many bytes to free.
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.
|
Free memory with tracked size made using AllocVec() |
|
|
Allocate memory given certain requirements |