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>MEMCreateExpHeapEx</TITLE> 12 13</HEAD> 14 15 16<BODY> 17 18 19<H1>MEMCreateExpHeapEx</H1> 20 21 22<H2>Syntax</H2> 23<DL><DD><PRE class="definition">#include <revolution/mem.h> 24 25MEMHeapHandle MEMCreateExpHeapEx( 26 void* startAddress, 27 u32 size, 28 u16 optFlag ); 29</PRE></DD></DL> 30 31<H2>Arguments</H2> 32<TABLE class="arguments" border="1"> 33 <TR> 34<TH><STRONG><EM><CODE>startAddress</CODE></EM></STRONG></TH> 35<TD>Start address of the memory region to allocate to the heap</TD> 36 </TR> 37 <TR> 38<TH>size</TH> 39<TD>Size in bytes of the memory region allocated to the heap</TD> 40 </TR> 41 <TR> 42<TH><STRONG><EM><CODE>optFlag</CODE></EM></STRONG></TH> 43<TD>Heap options (explained below)</TD> 44 </TR> 45</TABLE> 46 47<H2>Return Values</H2> 48<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> 49 50<H2>Description</H2> 51<P>Creates the expanded 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> 52<P>Heap options can be specified with <SPAN class="argument">optFlag</SPAN>.</P> 53<TABLE class="arguments" border="1"> 54 <TBODY> 55 <TR> 56<TH><CODE>MEM_HEAP_OPT_0_CLEAR</CODE></TH> 57<TD>The allocated memory block is filled with zeroes upon allocation from the heap.</TD> 58 </TR> 59 <TR> 60<TH><CODE>MEM_HEAP_OPT_DEBUG_FILL</CODE></TH> 61<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> 62 </TR> 63 <TR> 64<TH><CODE>MEM_HEAP_OPT_THREAD_SAFE</CODE></TH> 65<TD>Enables exclusive processing between threads. <FONT color="red">(Note that this will not run safely if it is called during an interrupt.)</FONT> 66 </TD> 67 </TR> 68 </TBODY> 69</TABLE> 70 71<H2>See Also</H2> 72<P class="reference"> 73<A href="MEMCreateExpHeap.html">MEMCreateExpHeap</A> 74</P> 75 76<H2>Revision History</H2> 77<P> 782007/08/20 Added a note regarding calling during interrupts.<BR>2006/03/01 Initial version.<BR> 79</P> 80 81<hr><p>CONFIDENTIAL</p></body> 82</HTML>