Ted, You still might want to consider implementing what I suggest. To address your specific points:
> that is more work that isn't necessary I guess your know your application best. But on this side of the e-mail, it's not clear to me why it's "more work". I mean, you'll have to allocate your buffers no matter what. Why is it more work to do it earlier than later? > i don't yield to other processes While the Palm OS doesn't export this functionality to 3rd party applications, it *is* a multi-threading operating system. And so other processes *could* get swapped in and allocate memory out from under you. Finally, while there are ways to determine how much free space is available, that doesn't necessarily mean that you can allocate a block that size, or even a number of smaller blocks totalling less than that size. You are limited by the sizes of the contiguous free areas in the heap (either currently extant or that can be created by compacting the heap). In short, the only way to know if your buffers will fit is to actually allocate those buffers and see if you succeed. -- Keith At 8:55 PM -0400 4/26/02, Ted Lowery wrote: >palm-dev-forum- > >Yes, I know *exactly* how much space I will need. > >I could do as you suggest, but that is more work that isn't necessary >since 1) my app is a limited to a specific use, not general use, and >2) i don't yield to other processes during the data gathering, so >nothing else can chew up the memory. > >So again I'll ask, > >What is the proper way to find the storage heap on a particular card? >ie, differentiate the storage heap from the dynamic heap and the rom >heaps? > >Thanks again for any help. > >Cheers, Ted > >-------------------------------------------------------------------------------- > >Re: Storage Heap > >From: Keith Rollin (view other messages by this author) >Date: Thu, 25 Apr 2002 19:49:57 > >At 10:41 PM -0400 4/25/02, Ted Lowery wrote: >>I want to examine the size of my storage heap before I begin a large >>data gathering process, since there is no reason to start the >>process if it will run out of database storage along the way. > >It sounds like you have some idea how much space you'll need before >hand. Why not pre-allocate that space and then fill it up as you >gather your data? If the pre-allocation fails, then you'll have the >same answer as if you took your suggested approach. And >pre-allocating has the benefit of making sure you'll still have room >towards the end of your data gathering process (that is, nothing else >will be able to come along and eat up the space you previously >thought was there). > >-- Keith > >Storage Heap > >-------------------------------------------------------------------------------- > >From: Ted Lowery (view other messages by this author) >Date: Thu, 25 Apr 2002 19:46:30 > >palm-dev-forum, > >What is the proper way to find the storage heap on a particular card? > >Examining card 0, I find 3 heaps, #0 seems to be the ROM heap, #1 >seems to be the storage heap, and #2 seems to be the dynamic heap, but >I can't see a way from the flags to tell the diff from the dynamic >heap and the storage heap. > >I want to examine the size of my storage heap before I begin a large >data gathering process, since there is no reason to start the process >if it will run out of database storage along the way. > >Thanks for your help. > > >-- >For information on using the Palm Developer Forums, or to >unsubscribe, please see http://www.palmos.com/dev/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
