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<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/os.h> 19 20void* OSAllocFixed(void** rstart, void** rend); 21</pre></dd></dl> 22 23<h2>Arguments</h2> 24<TABLE class="arguments" border="1" > 25 <tr> 26<TH><STRONG><EM><CODE>rstart</CODE></EM></STRONG></TH> 27<TD>Pointer to the start address of the block.</TD> 28 </tr> 29 <tr> 30<TH><STRONG><EM><CODE>rend</CODE></EM></STRONG></TH> 31<TD>Pointer to the end address of the block.</TD> 32 </tr> 33</TABLE> 34 35<h2>Return Values</h2> 36<P>Returns a null pointer if allocation is unsuccessful. Otherwise, returns a pointer to the 32-byte aligned region that was allocated. <SPAN class="argument">rstart</SPAN> and <SPAN class="argument">rend</SPAN> are used to correct the boundaries of the region since an amount of memory greater than required was probably actually allocated.</P> 37 38<H2>Description</H2> 39<P>Although this function is provided for compatibility, we recommend using the MEM library.</P> 40<P>Creates a block of memory that starts at <SPAN class="argument">rstart</SPAN> and ends at <SPAN class="argument">rend</SPAN>. Any overlaps in memory in heap will be removed from that heap. This can cause non-contiguous, fragmented heaps. As an alternative, this effect can be achieved using <a href="OSAddToHeap.html"><code>OSAddToHeap</code></a>. No check is made for any overlap of other fixed blocks. A 0-sized (zero-length) heap could also be generated.</P> 41<P>Allocation services must have been initialized with <code><a href="OSInitAlloc.html">OSInitAlloc</a></code> first.</P> 42<P><code>OSAllocFixed</code> must be called before any calls are made to <a href="OSAlloc.html"><code>OSAlloc</code></a>.</P> 43 44<h2>See Also</h2> 45<P class="reference"> 46<a href="../toc.html#Memory Allocation" target="contents">Memory Allocation Functions</a>, 47<a href="OSInitAlloc.html">OSInitAlloc</a>, 48<a href="OSAddToHeap.html">OSAddToHeap</a> 49</p> 50 51<H2>Revision History</H2> 52<P> 532006/03/01 Initial version. 54</P> 55 56<hr><p>CONFIDENTIAL</p></body> 57</html>