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>OSAllocFixed</title> 10</head> 11 12<body> 13 14<h1>OSAllocFixed</h1> 15 16 17<h2>C Specification</h2> 18 19<dl> 20<dd><pre><CODE>#include <revolution/os.h></CODE></pre></dd> 21<dd><pre>void* OSAllocFixed (void** rstart, void** rend); 22</CODE></pre></dd> 23</dl> 24 25<h2>Arguments</h2> 26<TABLE border="1" cellpadding="3" cellspacing="0.1"> 27 <tr> 28<TD width="120" bgcolor="#ffffe8"><code><em><strong><STRONG><EM><CODE>rstart</CODE></EM></STRONG></strong></em></code></TD> 29<TD width="520">Pointer to the start address of the block.</TD> 30 </tr> 31 <tr> 32<TD width="120" bgcolor="#ffffe8"><code><em><strong><STRONG><EM><CODE>rend</CODE></EM></STRONG></strong></em></code></TD> 33<TD width="520">Pointer to the end address of the block.</TD> 34 </tr> 35</TABLE> 36<h2>Return Values</h2> 37 38<P>Returns a null pointer if allocation is unsuccessful. If not, returns a pointer to the allocated region aligned to a 32-byte boundary. <CODE><EM><STRONG>rstart</STRONG></EM></CODE> and <CODE><EM><STRONG>rend</STRONG></EM></CODE> are adjusted to the actual boundaries of the allocated region, which is probably larger than the specified region.</P> 39<H2>Description</H2> 40<P>Although this function is provided for compatibility's sake, we recommend using the MEM library. </P> 41<P>Creates a block of memory that starts at <code><em><strong>rstart</strong></em></code> and ends at <code><em><strong>rend</strong></em></code>. Any overlaps in memory in heap will be removed from that heap. This can cause noncontiguous, fragmented heaps. As an alternative, this effect can be achieved using <a href="OSAddToHeap.html"><code>OSAddToHeap</code></a>. Other fixed blocks are not checked for any overlap. A size zero (zero length) heap can also be generated.</P> 42<P>The allocation process must be initialized using the <code><a href="OSInitAlloc.html">OSInitAlloc</a></code> function first.</P> 43<P>The <code>OSAllocFixed</code> function must be called before any calls to the <a href="OSAlloc.html"><code>OSAlloc</code></a> function.</P> 44 45 46 47<h2>See Also</h2> 48 49<p><a href="../list.html#Memory Allocation" target="contents">Memory Allocation Functions</a>, <code><a href="OSInitAlloc.html">OSInitAlloc</a>,<a href="OSAddToHeap.html">OSAddToHeap</a></code></p> 50<H2>Revision History</H2> 51<P>03/01/2006 Initial version.</P> 52</body> 53</html>