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="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows">
8
9<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
10
11	<TITLE>MEMCalcHeapSizeForUnitHeap</TITLE>
12
13</HEAD>
14
15
16<BODY>
17
18
19<H1>MEMCalcHeapSizeForUnitHeap</H1>
20
21<H2>Syntax</H2>
22<DL><DD><PRE class="construction">
23#include &lt;revolution/mem.h&gt;
24
25u32 MEMCalcHeapSizeForUnitHeap(
26                    u32     memBlockSize,
27                    u32     memBlockNum,
28                    int     alignment );
29</PRE></DD></DL>
30
31<H2>Arguments</H2>
32<TABLE class="arguments" border="1">
33  <TR>
34<TH><STRONG><EM><CODE>memBlockSize</CODE></EM></STRONG></TH>
35<TD>Size of the memory block in bytes</TD>
36  </TR>
37  <TR>
38<TH><STRONG><EM><CODE>memBlockNum</CODE></EM></STRONG></TH>
39<TD>Total number of reserved memory blocks</TD>
40  </TR>
41  <TR>
42<TH><STRONG><EM><CODE>alignment</CODE></EM></STRONG></TH>
43<TD>Memory block alignment. Can take any of the following values: 4, 8, 16, 32.</TD>
44  </TR>
45</TABLE>
46
47<H2>Return Values</H2>
48<P>The unit heap size calculated from the memory block size and the number of blocks is returned.</P>
49
50<H2>Description</H2>
51<P>Gets the size of the required unit heap from the size and number of the memory blocks. When creating a unit heap, the number of memory blocks specified in <SPAN class="argument">memBlockNum</SPAN> can be allocated from the unit heap by specifying the value obtained using this function as the size of the memory region to  allocate to the heap.</P>
52<P>This function does not take into consideration the start address of the unit heap that is actually created. As a result, if a value greater than 4 is specified for the alignment, the size may be a few bytes larger than needed.</P>
53
54<H2>See Also</H2>
55<P class="reference">
56<A href="MEMCreateUnitHeap.html">MEMCreateUnitHeap</A>,
57<A href="MEMCreateUnitHeapEx.html">MEMCreateUnitHeapEx</A>
58</P>
59
60<H2>Revision History</H2>
61<P>
622006/03/01 Initial version.<BR>
63</P>
64
65<hr><p>CONFIDENTIAL</p></body>
66</HTML>
67