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 16<BODY> 17 18 19<H1>MEMResizeForMBlockFrmHeap</H1> 20 21<H2>Syntax</H2> 22<DL><DD><PRE class="construction"> 23#include <revolution/mem.h> 24 25u32 MEMResizeForMBlockFrmHeap( 26 MEMHeapHandle heap, 27 void* memBlock, 28 u32 size ); 29</PRE></DD></DL> 30 31<H2>Arguments</H2> 32<TABLE class="arguments" border="1"> 33 <TR> 34<TH><STRONG><EM><CODE>heap</CODE></EM></STRONG></TH> 35<TD>Frame heap handle</TD> 36 </TR> 37 <TR> 38<TH><STRONG><EM><CODE>memBlock</CODE></EM></STRONG></TH> 39<TD>Pointer to the memory block to be resized</TD> 40 </TR> 41 <TR> 42<TH>size</TH> 43<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> 44 </TR> 45</TABLE> 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 50<H2>Description</H2> 51<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> 52<UL> 53<LI>Only the last allocated memory block that was allocated from the bottom of the free heap region. </LI> 54</UL> 55<P>To allocate a memory block from the beginning of an available heap region, specify a positive alignment value when using either the <A href="MEMAllocFromFrmHeap.html"><CODE>MEMAllocFromFrmHeap</CODE></A> or <A href="MEMAllocFromFrmHeapEx.html"><CODE>MEMAllocFromFrmHeapEx</CODE></A> function.</P> 56<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 there is insufficient available space, 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> 57<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> 58<P>This function doesn't check whether the value specified in <SPAN class="argument">memBlock</SPAN> indicates a pointer to a memory block that satisfies the conditions of this function. If a specified value doesn't satisfy the conditions, the behavior is unknown.</P> 59 60<H2>See Also</H2> 61<P class="reference"> 62<A href="MEMAllocFromFrmHeap.html">MEMAllocFromFrmHeap</A>, 63<A href="MEMAllocFromFrmHeapEx.html">MEMAllocFromFrmHeapEx</A>, 64<A href="MEMCreateFrmHeap.html">MEMCreateFrmHeap</A>, 65<A href="MEMCreateFrmHeapEx.html">MEMCreateFrmHeapEx</A> 66</P> 67 68<H2>Revision History</H2> 69<P> 702006/03/01 Initial version.<BR> 71</P> 72 73<hr><p>CONFIDENTIAL</p></body> 74</HTML> 75