"Chris DiPierro" <[EMAIL PROTECTED]> wrote in message
news:31424@palm-dev-forum...
> I mean I can't alloc a bunch of heap to use.
Whether your app is running or not, you need to limit your dynamic heap
consumption. In the latter case, you have even less room.
I have two ideas.
1. You could buffer the data in the storage heap. There are lots of ways to
do this, depending on what you need to do with the data afterwords, and
which versions of the OS you're using. You can use DmNewHandle and
DmResizeHandle to create and grow a chunk. You can use a temporary file
stream. You can use a feature pointer. All of these requires a bit of free
storage heap, but that's not a problem if you free up the buffer as you
create the new records.
2. You could read the data into one record, switching over to the other
record when you detect the end of the first record. This only works if you
can figure out where to put each byte without looking ahead. If you need
later bytes to figure out where earlier bytes go, then you have to buffer
the data someplace. You could use either of the records to do this, but then
a crash could result in a corrupted database. (This is arguably true in any
case.)
--
Danny Epstein
OS Engineer, Palm Inc.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/