Andy,

It is my understanding that if you use MemHandleFree() with MemHandleNew()
things go smoothly. The same is true if you use MemPtrFree() with
MemPtrNew(). But if you use MemPtrFree() with MemHandleNew() the OS has to
call MemPtrRecoverHandle() and then call MemHandleFree() for you. It still
works but it takes more time.

Actually, I never use MemHandleNew(). If I'm going to bother making a handle
I allocate it in database memory using DmNewHandle(), passing in the
DmOpenRef of any database that my application has open for the first
argument. This gives the benefit of a moveable chunk of memory, plus it
doesn't take up any dynamic heap space. The drawback is that I have to use
DmWrite(), but there's reasonable ways to manage that. If it's too much of a
burden I just allocate a pointer instead.

Bob Whiteman
Senior Software Engineer
Pico Communication



-- 
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