--- Andy Yeong wrote: > As a matter for better understanding, I'm wondering is there > any difference between the 2 program. > > char *testPtr; > MemHandle testH; > testH = MemHandleNew(10); // just create a memory of 10 bytes > testPtr = MemHandleLock(testH); > > Program 1's freeing method > ---------------------------- > MemHandleUnlock(testH); > MemHandleFree(testH); > > Program 2's freeing method > ---------------------------- > MemPtrFree(testPtr); >
I don't know about possible differences in clock cycles, but to help avoid the problem of unlocking something that isn't locked or freeing something that isn't in allocated, it would be better to always pair MemHandleNew with MemHandleFree, MemHandleLock with MemHandleUnlock, and MemPtrNew with MemPtrFree. __________________________________________________ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
