Ben Combee wrote:
So, is there some mechanism where the OS can notify me when
memory is getting too low so that I can free up some of my
stuff?
You might want to allocate an emergency buffer at program start and
funnel allocations through a routine that will first try MemPtrNew, and
if it fails, free the emergency buffer and try again, sending a "low
memory" notification at the same time.
If I have a way to funnel all allocations through something, then I
can just have that something dump the cache right then and there if
an allocation fails, then try the allocation again. The emergency
buffer idea could make certain things a little easier (like not
having to ensure my cache-freeing stuff avoids using the heap).
But what I'm really trying to achieve is to not have to wrap all
allocations in something. When I have to do that, that means my
cache code sends out tentacles into all kinds of other unrelated
code, it makes it hard to use libraries, etc., etc. Plus, for all
I know, the device itself may need to use heap in the background
for something like receiving and storing a text message or some
other background task, and I can't wrap its memory allocation
calls...
- Logan
To unsubscribe send an email to [EMAIL PROTECTED]
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/