[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'Exec' (#aros)


Allocate memory and keep track of the size


Source position: exec.pas line 1322

function AllocVec(

  ByteSize: ULONG;

  Requirements: ULONG





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)



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_*)

Function result

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.

See also



Free memory with tracked size made using AllocVec()



Allocate memory given certain requirements

Documentation generated on: 2017-01-10