AllocMemFromMemList

Allocates memory from a private memory pool.

Synopsis

void *AllocMemFromMemList( MemList *ml, int32 size, uint32 memflags)

Description

A task can do its own memory management by creating one or more private memory lists. Use this procedure to allocate a memory block from a private memory list.

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.

To create a private memory list, use the AllocMemList() procedure.

Arguments

ml
A pointer to the private memory list from which to allocate the memory block.
size
The size of the memory block to allocate, in bytes.
memflags
Flags that specify the type of memory to allocate. These flags include MEMTYPE_ANY, MEMTYPE_VRAM, MEMTYPE_DRAM, MEMTYPE_BANKSELECT, MEMTYPE_BANK1, MEMTYPE_BANK2, MEMTYPE_DMA, MEMTYPE_CEL, MEMTYPE_AUDIO, MEMTYPE_DSP, MEMTYPE_FILL, MEMTYPE_INPAGE, MEMTYPE_TRACKSIZE, and MEMTYPE_STARTPAGE. For information about these flags, see the description of AllocMem().

Return Value

The procedure returns a pointer to the allocated memory or NULL if the memory couldn't be allocated.

Implementation

Folio call implemented in kernel folio V20.

Associated Files

mem.h
ANSI C Prototype
clib.lib
ARM Link Library

Notes

To free a memory block allocated with AllocMemFromMemList(), use the FreeMemToMemList() procedure.

See Also

AllocMemList(), FreeMemToMemList()