1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<title>MIAllocatorAllocFunction</title>
8<link rel="stylesheet" href="../../css/nitro.css" type="text/css" />
9</head>
10<body>
11<h1>MIAllocatorAllocFunction <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></h1>
12<h2>Definition</h2>
13
14<dl>
15  <dd>
16  <pre><code>#include &lt;nitro/mi.h&gt;<br />
17typedef void* (*MIAllocatorAllocFunction)(void *userdata, u32 length, u32 alignment);
18</code></pre>
19  </dd>
20</dl>
21
22<h2>Arguments</h2>
23<table border="1" width="100%">
24  <tbody>
25    <tr>
26      <td style="width:13%"><em><strong>userdata</strong></em></td>
27      <td style="width:87%">An arbitrary user-defined value specified with <a href="MI_InitAllocator.html"><CODE>MI_InitAllocator()</CODE></a>.<br />
28      This is provided for the sake of convenience in implementing callback functions.</td>
29    </tr>
30    <tr>
31      <td style="width:13%"><em><strong>length</strong></em></td>
32      <td style="width:87%">Memory size to be allocated.</td>
33    </tr>
34    <tr>
35      <td style="width:13%"><em><strong>alignment</strong></em></td>
36      <td style="width:87%">Boundary alignment required for memory addresses.</td>
37    </tr>
38  </tbody>
39</table>
40
41<h2>Return Values</h2>
42<p>Must return the memory actually allocated if successful; otherwise NULL.</p>
43
44<h2>Description</h2>
45<p>
46This function prototype represents the format of callback functions used to allocate memory from the allocator.<BR>Use this format to implement a memory allocation operation and to specify your implementation in <a href="MI_InitAllocator.html"><CODE>MI_InitAllocator()</CODE></a>.
47</p>
48
49<h2>See Also</h2>
50<p><code><a href="MIAllocator.html">MIAllocator</a>, <a href="MIAllocatorFreeFunction.html">MIAllocatorFreeFunction</a> <br /> <a href="MI_InitAllocator.html">MI_InitAllocator</a>, <a href="MI_CallAlloc.html">MI_CallAlloc</a>, <a href="MI_CallFree.html">MI_CallFree</a></code></p>
51<h2>Revision History</h2>
52<p>2007/06/12 Initial version.</p>
53<hr><p>CONFIDENTIAL</p></body>
54</html>
55