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<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/os.h&gt;
19
20OSHeapHandle OSCreateHeap(void* start, void* end);
21</pre></dd></dl>
22
23<h2>Arguments</h2>
24<TABLE class="arguments" border="1" >
25  <tr>
26<TH>start</TH>
27<TD>Heap starting address.</TD>
28  </tr>
29  <tr>
30<TH>end</TH>
31<TD>Heap ending address.</TD>
32  </tr>
33</TABLE>
34
35<h2>Return Values</h2>
36<p>If successful, returns a new handle to the heap for use by the <A href="OSAllocFromHeap.html"><CODE>OSAllocFromHeap</CODE></A> and <A href="OSFreeToHeap.html"><CODE>OSFreeToHeap</CODE></A> functions. If not, returns -1.</p>
37
38<H2>Description</H2>
39<P>Although this function is provided for the sake of compatibility, we recommend using the MEM library.</P>
40<P>Reserves a memory region from <SPAN class="argument">start</SPAN> to <SPAN class="argument">end</SPAN> to use as a heap. Initializes heap descriptor and free list.<br>Consumes one entry in the heap array.</P>
41<P>The memory allocation services must be initialized by the <A href="OSInitAlloc.html"><CODE>OSInitAlloc</CODE></A> function.</P>
42
43<h2>See Also</h2>
44<P class="reference">
45<a href="../toc.html#Memory Allocation" target="contents">Memory Allocation Functions</a>,
46<a href="OSInitAlloc.html">OSInitAlloc</a>,
47<a href="OSAllocFromHeap.html">OSAllocFromHeap</a>,
48<a href="OSDestroyHeap.html">OSDestroyHeap</a>,
49<a href="OSFreeToHeap.html">OSFreeToHeap</a>
50</p>
51
52<H2>Revision History</H2>
53<P>
542006/03/01 Initial version.<br>
55</P>
56
57<hr><p>CONFIDENTIAL</p></body>
58</html>