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="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>OS_AllocFixed</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">OS_AllocFixed <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <nitro/os.h></CODE></PRE> 16 <PRE><CODE>void* OS_AllocFixed( OSArenaId id, void** rstart, void** rend );</CODE></PRE> 17</DL> 18<H2>Arguments</H2> 19<TABLE border="1" width="100%"> 20 <TBODY> 21 <TR> 22 <TD width="13%"><EM><STRONG>id</STRONG></EM></TD> 23 <TD width="87%">Arena ID of the arena associated with the region that will be allocated.</TD> 24 </TR> 25 <TR> 26 <TD><B><I>rstart</I></B></TD> 27 <TD>Pointer to a block start address.</TD> 28 </TR> 29 <TR> 30 <TD><B><I>rend</I></B></TD> 31 <TD>Pointer to a block end address.</TD> 32 </TR> 33 </TBODY> 34</TABLE> 35<H2>Return Values</H2> 36<P>If the specified block has been allocated, the 32-byte aligned start address is returned. <BR>If <EM><STRONG><CODE>rstart</CODE></STRONG></EM> and <EM><STRONG><CODE>rend</CODE></STRONG></EM> are larger than the region requested, they will be revised to the region's actual start and end address.</P> 37<H2>Description</H2> 38<P>Allocates the specified region.</P> 39<P>The arena is specified with the arena ID (<em><strong>id</strong></em>). To read more about this value, see <a href="../arena/OS_InitArena.html"><code>OS_InitArena</code></a>. Areas overlapping memory blocks of other heaps in the arena will be erased from the heap. This can cause non-contiguous, fragmented heaps. Using <A href="OS_AddToHeap.html"><CODE>OS_AddToHeap</CODE></A> could also cause this phenomenon. No check is made for any overlap of other fixed blocks. A 0-sized (zero-length) heap could also be generated.</P> 40<P>The <CODE>OS_AllocFixed</CODE> function must be called before any other call related to <A href="OS_AllocFromHeap.html"><CODE>OS_Alloc*()</CODE></A>. </P> 41<H2>See Also</H2> 42<P><CODE><A href="../arena/OS_InitArena.html">OS_InitArena</A>, <A href="OS_AddToHeap.html">OS_AddToHeap</A>, <A href="OS_AllocFromHeap.html">OS_AllocFromHeap</A><BR></CODE></P> 43<H2>Revision History</H2> 44<P>2004/01/06 Initial version.</P> 45<hr><p>CONFIDENTIAL</p></body> 46</HTML>