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>MEMResizeForMBlockFrmHeap</TITLE>
12
13</HEAD>
14
15<BODY>
16
17<H1>MEMResizeForMBlockFrmHeap</H1>
18
19
20<H2>C Specification</H2>
21<PRE class="construction">#include &lt;revolution/mem.h&gt;
22
23u32 MEMResizeForMBlockFrmHeap(
24	MEMHeapHandle    heap,
25	void*            memBlock,
26	u32              size );</PRE>
27
28
29<H2>Arguments</H2>
30<TABLE border="1">
31
32    <TR>
33	<TD><STRONG><EM><CODE>heap</CODE></EM></STRONG></TD>
34	<TD>The frame heap handle.</TD>
35</TR>
36    <TR>
37<TD><STRONG><EM><CODE>memBlock</CODE></EM></STRONG></TD>
38<TD>Pointer to the memory block to change in size.</TD>
39    </TR>
40    <TR>
41<TD><STRONG><EM><CODE>size</CODE></EM></STRONG></TD>
42<TD>Size in bytes of the memory block change. If a value less than four is specified, four is used to process the memory block.</TD>
43    </TR>
44  </TABLE>
45
46
47<H2>Return Values</H2>
48<P>If the function succeeds, returns the size in bytes of the changed memory block. Otherwise, zero is returned.</P>
49<H2>Description</H2>
50<P>This function changes the size of an allocated memory block in the frame heap. However, this function can only be applied to memory blocks that meet the following condition.</P>
51<UL>
52<LI>Only the last allocated memory block that was allocated from the bottom of the free heap region. </LI>
53</UL>
54<P>Use either the <code><A href="MEMAllocFromFrmHeapEx.html">MEMAllocFromFrmHeap</A></code> or the <code><A href="MEMAllocFromFrmHeap.html">MEMAllocFromFrmHeapEx</A></code> function and specify a positive alignment value to allocate a memory block from the bottom of the free heap region.</P>
55<P>When increasing the current size of the memory block, there must be enough free space after the memory block to increase the size. If the free region is insufficient, the function fails and returns zero. If the size increase of the memory block is successful, the size increase may be greater than the specified size.</P>
56<P>Decreasing the memory block size is impossible if the size decrease is a few bytes. In this case, the current size of the memory block is returned.</P>
57<P>This function doesn't check whether the value that <CODE>memBlock</CODE> specifies points to the memory block that satisfies the conditions of this function. If a specified values doesn't satisfy the conditions, the behavior is unknown.</P>
58<H2>See Also</H2>
59<P class="reference"><A href="MEMAllocFromFrmHeap.html">MEMAllocFromFrmHeap</A>, <A href="MEMAllocFromFrmHeapEx.html">MEMAllocFromFrmHeapEx</A>, <A href="MEMCreateFrmHeap.html">MEMCreateFrmHeap</A>, <A href="MEMCreateFrmHeapEx.html">MEMCreateFrmHeapEx</A></P>
60
61
62<H2>Revision History</H2>
63<P>03/01/2006 Initial version.</P>
64
65
66</BODY>
67</HTML>
68