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.1.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>OS_ClearExtraHeap</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">OS_ClearExtraHeap<IMG src="../../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14  <DD>
15  <PRE><CODE>#include &lt;nitro/os.h&gt;</CODE></PRE>
16  <PRE><CODE>void OS_ClearExtraHeap( OSArenaId id, OSHeapHandle heap );
17  </CODE></PRE>
18</DL>
19<H2>Arguments</H2>
20<TABLE border="1" width="100%">
21  <TBODY>
22    <TR>
23<TD width="13%"><EM><STRONG>id</STRONG></EM></TD>
24<TD width="87%">Arena ID of the arena that includes the special heap to be cleared</TD>
25    </TR>
26    <TR>
27<TD width="13%"><EM><STRONG>heap</STRONG></EM></TD>
28<TD width="87%">Heap handler of the special heap to be cleared</TD>
29    </TR>
30  </TBODY>
31</TABLE>
32<H2>Return Values</H2>
33<P>None.</P>
34<H2>Description</H2>
35<P>Clears and initializes an existing special heap.</P>
36<P>This function clears the special heap created by the <A href="OS_CreateExtraHeap.html"><CODE>OS_CreateExtraHeap</CODE></A> function. Use the <A href="OS_ClearHeap.html"><CODE>OS_ClearHeap</CODE></A> function for ordinary heaps created using the <A href="OS_CreateHeap.html"><CODE>OS_CreateHeap</CODE></A> function.</P>
37<P>The arena ID should be an argument for the <A href="OS_CreateExtraHeap.html"><CODE>OS_CreateExtraHeap</CODE></A> function, and <SPAN class="argument">heap</SPAN>, the heap handler, should be the return value for the <A href="OS_CreateExtraHeap.html"><CODE>OS_CreateExtraHeap</CODE></A> function. Nothing happens if a value is specified that is different from the parameter for the special heap held internally on the system.</P>
38<P>All memory blocks secured in <SPAN class="argument">heap</SPAN> are destroyed. However, that is for the 16-KB region at the top of the main memory, and when there is an enclave by the <A href="OS_AddToHeap.html"><CODE>OS_AddToHeap</CODE></A> function, that does not get targeted for initialization. Moreover, caution is advised because upon initialization, that region is removed from part of the heap.</P>
39<P><FONT color="#ff0000">This function cannot be called for NITRO ROM and TWL limited ROM. </FONT>(It exists only for hybrid ROM builds, so a compile error is generated. )  Also, <FONT color="#ff0000">This function does nothing even if called while a hybrid ROM is running on TWL hardware in TWL mode.</FONT></P>
40<H2>See Also</H2>
41<P><A href="OS_InitAlloc.html"><CODE>OS_InitAlloc</CODE></A><BR> <A href="OS_CreateExtraHeap.html"><CODE>OS_CreateExtraHeap</CODE></A><BR> <A href="OS_AddExtraAreaToHeap.html"><CODE>OS_AddExtraAreaToHeap</CODE></A></P>
42<H2>Revision History</H2>
43<P>2009/04/03 Initial version.</P>
44<hr><p>CONFIDENTIAL</p></body>
45</HTML>