void *AllocMemFromMemLists( List *l, int32 size, uint32 memflags)
Note: Most applications do not need to do their own memory management. When you use standard memory-allocation procedures like AllocMem()
, the details of memory management are handled for you by the kernel.
The free memory pools in Portfolio are implemented as lists of memory lists:
AllocMemFromMemLists()
allocates memory directly from a particular memory pool. This is in contrast to AllocMemFromMemList()
, which allocates memory from a specific memory list, typically one that was created by the task for doing its own memory management.
Note: Tasks can only allocate memory from memory lists that belong to them. This means that user tasks cannot use AllocMemFromMemLists()
to allocate memory directly from the system-wide free memory pool, because the memory in that pool belongs to the system.
If a task requests more memory from its free memory pool than is available, the kernel automatically allocates the necessary additional memory pages from the system-wide free memory pool if they are available. The task gets ownership of the additional memory and, when the memory is later freed, it is added to the task's free memory pool.
AllocMemFromMemLists()
, use the FreeMemToMemLists()
procedure.
You can enable memory debugging in your application by compiling your entire project with the MEMDEBUG value defined on the compiler's command-line. Refer to the CreateMemDebug()
function for more details.
AllocMemFromMemLists
()