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="Microsoft FrontPage 5.0">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8<TITLE>OSInitAlloc</TITLE>
9</HEAD>
10<BODY>
11<H1>OSInitAlloc</H1>
12<H2>C Specification</H2>
13<DL>
14  <DD>
15<PRE><CODE>#include &lt;revolution/os.h&gt;</CODE></PRE>
16  <DD>
17<PRE><code>void* OSInitAlloc (void* arenaStart, void* arenaEnd, int maxHeaps);</code></PRE>
18</DL>
19<H2>Arguments</H2>
20<TABLE border="1" cellpadding="3" cellspacing="0.1">
21  <TBODY>
22    <TR>
23<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><STRONG><EM><CODE>arenaStart</CODE></EM></STRONG></EM></STRONG></CODE></TD>
24<TD width="520">Arena start address.</TD>
25    </TR>
26    <TR>
27<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><STRONG><EM><CODE>arenaEnd</CODE></EM></STRONG></EM></STRONG></CODE></TD>
28<TD width="520">Arena end address.</TD>
29    </TR>
30    <TR>
31<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><STRONG><EM><CODE>maxHeaps</CODE></EM></STRONG></EM></STRONG></CODE></TD>
32<TD width="520">Maximum number of active heaps that will be used in the program lifetime.</TD>
33    </TR>
34  </TBODY>
35</TABLE>
36<H2>Return Values</H2>
37<P>Real arena start address aligned to a 32-byte boundary after the heap array has been allocated.</P>
38<H2>Description</H2>
39<P>Although this function is provided for compatibility's sake, we recommend using the MEM library.  </P>
40<P>Initializes memory allocation services and the arena in which all heaps will reside.&nbsp;This routine must be called before creating a heap. </P>
41<P>At the beginning of the arena, a small region of memory is reserved for a heap descriptor array. The base address of the new arena is returned. </P>
42
43<H2>See Also</H2>
44<P><a href="../list.html#Memory Allocation" target="contents">Memory Allocation Functions</a>, <a href="OSCreateHeap.html"><code>OSCreateHeap</code></a>, <code><a href="OSDestroyHeap.html">OSDestroyHeap</a></code></P>
45<H2>Revision History</H2>
46<P>03/01/2006 Initial version.</P>
47</BODY>
48</HTML>