MemPtrNew
Allocates a new NONMOVABLE chunk in the dynamic heap.
and
MemHandleNew
Allocates a new MOVABLE chunk in the dynamic heap and returns a
handle to it.
When the memory manager allocates a nonmovable chunk it re-turns
a pointer to that chunk. The pointer is simply that chunk�s address
in memory. Because the chunk cannot move, its pointer re-mains
valid for the chunk�s lifetime; thus, the pointer can be passed
�as is� to the caller that requested the allocation.
When the memory manager allocates a movable chunk, it gener-ates
a pointer to that chunk, just as it did for the nonmovable chunk,
but it does not return the pointer to the caller. Instead, it stores the
pointer to the chunk, called the master chunk pointer, in a master
pointer table that is used to track all of the moveable chunks in the
heap, and returns a reference to the master chunk pointer. This ref-erence
to the master chunk pointer is known as a handle. It is this
handle that the memory manager returns to the caller that requested
the allocation of a moveable chunk.
Using handles imposes a slight performance penalty over direct
pointer access but permits the memory manager to move chunks
around in the heap without invalidating any chunk references that
an application might have stored away. As long as an application
uses handles to reference data, only the master pointer to a chunk
needs to be updated by the memory manager when it moves a
chunk during defragmentation.
I hope that this clarifies your doubt
KUNAL