I've thrown wrappers around MemHandleNew and MemHandleResize. I'd like 
those wrappers to be able to compact the heap if either of the underlying 
functions returns an error. The problem is: I don't know which heap to compact.

What I want to do is something like:

MemHandle h;

h = MemHandleNew(size);
if (!h) {
        MemHeapCompact( ??? );
        h = MemHandleNew(size);
}
if (h) return h;
else ScreamRealLoud();

I can get a heapID from an allocated MemHandle, but how do I find out from 
which heap MemHandleNew tried to allocate when it failed?

Is it the case that all of my MemHandleNew calls will be guaranteed to come 
from the same heap? What about in future revs of the OS?

Curtis Jackson
Director of Engineering
Aniwhere, Inc.
[EMAIL PROTECTED]



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to