1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
9<title>OSCreateHeap</title>
10</head>
11
12<body>
13
14<h1>OSCreateHeap</h1>
15
16
17<h2>C Specification</h2>
18
19<dl>
20<dd><pre><CODE>#include &lt;revolution/os.h&gt;</CODE></pre></dd>
21<dd><pre>OSHeapHandle OSCreateHeap (void* start, void* end);</pre></dd>
22</dl><h2>Arguments</h2>
23<TABLE border="1" cellpadding="3" cellspacing="0.1">
24  <tr>
25<TD width="120" bgcolor="#ffffe8"><em><strong><code><STRONG><EM><CODE>start</CODE></EM></STRONG></code></strong></em></TD>
26<TD width="520">Heap starting address.</TD>
27    </tr>
28  <tr>
29<TD width="120" bgcolor="#ffffe8"><em><strong><code><STRONG><EM><CODE>end</CODE></EM></STRONG></code></strong></em></TD>
30<TD width="520">Heap ending address.</TD>
31    </tr>
32</TABLE>
33<h2>Return Values</h2>
34
35<p>If successful, returns a new heap handle to use with the <CODE>OSAllocFromHeap</CODE></A> and <A href="OSFreeToHeap.html"><CODE>OSFreeToHeap</CODE></A> functions. If not successful, returns -1.</p>
36<H2>Description</H2>
37<P>Although this function is provided for compatibility's sake, we recommend using the MEM library.  </P>
38<P>Reserves memory region from <code><strong><em>start</em></strong></code> to <code><strong><em>end</em></strong></code> to use as a heap. Initializes heap descriptor and free list.<br>Consumes one entry in heap array.</P>
39<P>Memory allocation processing must be initialized by the <code><a href="OSInitAlloc.html">OSInitAlloc</a></code> function first.</P>
40
41
42
43<h2>See Also</h2>
44
45<p><a href="../list.html#Memory Allocation" target="contents">Memory Allocation Functions</a>, <code><a href="OSInitAlloc.html">OSInitAlloc</a>,<a href="OSAllocFromHeap.html">OSAllocFromHeap</a></code>, <a href="OSDestroyHeap.html"><code>OSDestroyHeap</code></a>, <a href="OSFreeToHeap.html"><code>OSFreeToHeap</code></a></p>
46<H2>Revision History</H2>
47<P>03/01/2006 Initial version.</P>
48</body>
49</html>