# MIAllocatorAllocFunction

## Definition

      #include <nitro/mi.h>

      typedef void* (*MIAllocatorAllocFunction)(void *userdata, u32 length, u32 alignment);

## Arguments

userdata | An arbitrary user-defined value specified with `MI_InitAllocator()`. This is provided for the sake of convenience in implementing callback functions.
length | Memory size to be allocated.
alignment | Boundary alignment required for memory addresses.

## Return Values

Must return the memory actually allocated if successful; otherwise NULL.

## Description

This function prototype represents the format of callback functions used to allocate memory from the allocator.
Use this format to implement a memory allocation operation and to specify your implementation in `MI_InitAllocator()`.

## See Also

`MIAllocator, MIAllocatorFreeFunction
MI_InitAllocator, MI_CallAlloc, MI_CallFree`

## Revision History

2007/06/12 Initial version.

CONFIDENTIAL