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 http-equiv="Content-Style-Type" content="text/css">
7<META name="GENERATOR" content="Microsoft FrontPage 5.0">
8
9<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
10
11	<TITLE>MEMCreateFrmHeapEx</TITLE>
12
13</HEAD>
14
15
16<BODY>
17
18
19<H1>MEMCreateFrmHeapEx</H1>
20
21<H2>Syntax</H2>
22<DL><DD><PRE class="construction">#include &lt;revolution/mem.h&gt;
23
24MEMHeapHandle MEMCreateFrmHeapEx(
25                    	void*       startAddress,
26                    	u32         size,
27                    	u16         optFlag );
28</PRE></DD></DL>
29
30<H2>Arguments</H2>
31<TABLE class="arguments" border="1">
32  <TR>
33<TH><STRONG><EM><CODE>startAddress</CODE></EM></STRONG></TH>
34<TD>Start address of the memory region to allocate to the heap</TD>
35  </TR>
36  <TR>
37<TH>size</TH>
38<TD>Size in bytes of the memory region allocated to the heap</TD>
39  </TR>
40  <TR>
41<TH><STRONG><EM><CODE>optFlag</CODE></EM></STRONG></TH>
42<TD>Heap options (explained below)</TD>
43  </TR>
44</TABLE>
45
46<H2>Return Values</H2>
47<P>Returns the heap handle when a heap was successfully created. Returns <CODE>MEM_HEAP_INVALID_HANDLE</CODE> (a null value) if a heap could not be created.</P>
48
49<H2>Description</H2>
50<P>Creates the frame heap. The heap region is a memory region with size <SPAN class="argument">size</SPAN> and a start address specified by <SPAN class="argument">startAddress</SPAN>.</P>
51<P>Heap options can be specified with <SPAN class="argument">optFlag</SPAN>.</P>
52<TABLE class="arguments" border="1">
53  <TBODY>
54    <TR>
55<TH><CODE>MEM_HEAP_OPT_0_CLEAR</CODE></TH>
56<TD>The allocated memory block is filled with zeroes upon allocation from the heap.</TD>
57    </TR>
58    <TR>
59<TH><CODE>MEM_HEAP_OPT_DEBUG_FILL</CODE></TH>
60<TD>Upon heap creation or whenever memory blocks are allocated or freed, each is filled with different 32-bit values in the memory region. This flag is used for debugging to find memory access bugs caused by either a failure to initialize memory or invalid memory regions. This option is not valid for the <code>FINALROM</code> version of the library.</TD>
61    </TR>
62    <TR>
63<TH><CODE>MEM_HEAP_OPT_THREAD_SAFE</CODE></TH>
64<TD>Enables exclusive processing between threads. <FONT color="red">(Note that this will not run safely if it is called during an interrupt.)</FONT>
65      </TD>
66     </TR>
67  </TBODY>
68</TABLE>
69
70<H2>See Also</H2>
71<P class="reference">
72<A href="MEMCreateFrmHeap.html">MEMCreateFrmHeap</A>
73</P>
74
75<H2>Revision History</H2>
76<P>
772007/08/20 Added a note regarding calling during interrupts.<BR>2006/03/01 Initial version.<BR>
78</P>
79
80<hr><p>CONFIDENTIAL</p></body>
81</HTML>