"Curtis Jackson" <[EMAIL PROTECTED]> wrote in message
news:46567@palm-dev-forum...
>
> > From the documentation to the MemHandleNew and MemPtrNew functions,
> >these are supposed to compact the heap and try again if there is a
> >failure anyway.  I don't see what your wrapper is supposed to do.
>
> I agree, the documentation hints that those functions would do it for
you.
> But...
>
>  From a note under the Reference doc for MemHeapFreeBytes:
>
> "An alternative approach is to just call the MemHeapCompact function
as
> necessary when an error is returned by the MemPtrNew or MemHandleNew
> functions."
>
> My philosophy with the many horrors of Palm documentation is:
>
> If I cannot empirically verify it, err on the side of safety.

>From a quick inspection of the Palm OS 3.0 and 3.5 memory manager code,
yes both MemHandleNew and MemPtrNew will compact the heap as a last
resort if they can't find a free chunk large enough for the request.

The MemHeapFreeBytes documentation was probably written back in the Palm
OS 2.0 days.  Also, rememeber that the database stores are also
considered heaps, just heaps with special writing requirements.  In the
Palm OS 2.0 days, it was quite possible to get fragmentation within each
individual heap, but with 3.0+'s unifed heap model for database storage,
this has become much less of a concern.

--
Ben Combee, [EMAIL PROTECTED]
Techwood Broadcasting Foundation, Austin Bureau



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