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>OSAlloc</title>
10</head>
11
12<body>
13
14<h1>OSAlloc</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/os.h&gt;
19
20void* OSAlloc(u32 size);
21</pre></dd></dl>
22
23<h2>Arguments</h2>
24<TABLE class="arguments" border="1" >
25  <tr>
26<TH>size</TH>
27<TD>Size of object to allocate.</TD>
28  </tr>
29</TABLE>
30
31<h2>Return Values</h2>
32<p>Returns a null pointer if allocation is unsuccessful. Otherwise, returns a pointer to the allocated region, aligned to a 32-byte boundary.
33</p>
34
35<H2>Description</H2>
36<P>Although this function is provided for the sake of compatibility, we recommend using the MEM library.</P>
37<P>Allocates <SPAN class="argument">size</SPAN> bytes from the current heap.</P>
38<P>The memory allocation services must have first been initialized by the <A href="OSInitAlloc.html"><CODE>OSInitAlloc</CODE></A> and <A href="OSCreateHeap.html"><CODE>OSCreateHeap</CODE></A> functions; the heap is created by the <A href="OSCreateHeap.html"><CODE>OSCreateHeap</CODE></A> function.</P>
39
40<h2>See Also</h2>
41<P class="reference">
42<a href="../toc.html#Memory Allocation" target="contents">Memory Allocation Functions</a>,
43<a href="OSInitAlloc.html">OSInitAlloc</a>,
44<a href="OSCreateHeap.html">OSCreateHeap</a>,
45<a href="OSAllocFromHeap.html">OSAllocFromHeap</a>,
46<a href="OSFree.html">OSFree</a>,
47<a href="OSSetCurrentHeap.html">OSSetCurrentHeap</a>
48</p>
49
50<H2>Revision History</H2>
51<P>
522006/03/01 Initial version.<br>
53</P>
54
55<hr><p>CONFIDENTIAL</p></body>
56</html>