# Function Calls

The following list contains the memory calls. See Kernel Folio Calls in the 3DO System Programmer's Reference for more information on these calls.

## Allocating Memory

The following calls allocate memory:

- `AllocMem()` Allocates a specified memory block.
- `malloc()` Allocates memory.

## Freeing Memory

The following calls free memory:

- `FreeMem()` Frees memory allocated with `AllocMem()`.
- `free()` Frees memory allocated with `malloc()`.

## Getting Information About Memory

The following calls get information about available memory:

- `AvailMem()` Gets information about available memory.
- `GetBankBits()` Finds out which VRAM bank contains a memory location.
- `GetMemType()` Gets the type of the specified memory.
- `GetPageSize()` Gets the number of bytes in a memory page.

## Reclaiming Unused Memory

The following call reclaims unused memory:

- `ScavengeMem()` Returns a task's unused memory pages to the system-wide memory pool.

## Changing the Control Status of Memory

The following call changes the status of memory:

- `ControlMem()` Grants or revokes write permission to memory, or gives memory to another task.

## Using Private Memory Lists

The following calls deal with private lists:

- `AllocMemFromMemList()` Allocates memory from a private memory pool.
- `FreeMemList()` Frees a memory list.
- `FreeMemToMemList()` Frees a private block of memory.

## Using Memory Pools

The following calls allocate and free memory pools.

- `AllocMemBlocks()` Transfers pages of memory from the system-wide free memory pool.
- `AllocMemFromMemLists()` Allocates a memory block from a list of memory lists.
- `FreeMemToMemLists()` Returns a block of memory to a free memory pool.

## Debugging Memory Problems

The following calls find problems with memory.

- `CreateMemDebug()` Initializes memory debugging package
- `DeleteMemDebug()` Releases memory debugging resources
- `DumpMemDebug()`Dumps memory allocation debugging information
- `SanityCheckMemDebug()`Checks all current memory allocations to make sure all of the allocation cookies are intact