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>OSAllocFromHeap</TITLE> 9</HEAD> 10<BODY> 11<H1>OSAllocFromHeap</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/os.h> 16 17void* OSAllocFromHeap(OSHeapHandle heap, u32 size); 18</pre></dd></dl> 19 20<H2>Arguments</H2> 21<TABLE class="arguments" border="1" > 22 <TBODY> 23 <TR> 24<TH><STRONG><EM><CODE>heap</CODE></EM></STRONG></TH> 25<TD>Handle to a heap that was returned from the <A href="OSCreateHeap.html"><CODE>OSCreateHeap</CODE></A> function</TD> 26 </TR> 27 <TR> 28<TH>size</TH> 29<TD>Size of object to be allocated.</TD> 30 </TR> 31 </TBODY> 32</TABLE> 33 34<H2>Return Values</H2> 35<P>Returns a null pointer if allocation is unsuccessful. Otherwise, returns a pointer to the allocated region, aligned to a 32-byte boundary.</P> 36 37<H2>Description</H2> 38<P>Although this function is provided for the sake of compatibility, we recommend using the MEM library.</P> 39<P>Allocates <SPAN class="argument">size</SPAN> bytes of memory from <SPAN class="argument">heap</SPAN>. Supplementary regions will be consumed from this heap. This overwrites the heap selected by the <A href="OSSetCurrentHeap.html"><CODE>OSSetCurrentHeap</CODE></A> function for this allocation.</P> 40<P>The memory allocation services must be initialized by the <A href="OSInitAlloc.html"><CODE>OSInitAlloc</CODE></A> function.</P> 41 42<H2>See Also</H2> 43<P class="reference"> 44<A href="../toc.html#Memory Allocation" target="contents">Memory Allocation Functions</A>, 45<A href="OSInitAlloc.html">OSInitAlloc</A>, 46<A href="OSCreateHeap.html">OSCreateHeap</A>, 47<A href="OSFreeToHeap.html">OSFreeToHeap</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>