Hello,

In my app I create an index of books/PDBs installed on the device.  The
structure I use is 308 bytes in size with nearly all of that devoted to the
VFS filename (255 bytes).

My program allocates very few small chunks of memory.  Rather, I allocate
larger arrays and grow them if necessary.  Most of the time this is fine
because there isn't much wasted space.  For filenames, they are rarely
255 bytes long, but they *can* be.  Hence the need to allocate the extra space
in the array.

Unfortunately, at 308 bytes per item, the index is limited to ~210 total items
before the 64K allocation limit is reached.

One possible solution is to simply store a pointer to a string in the index
array.  Then allocate only how much space is needed for the filename.

But, for somebody who has, say, 300 books, this is a lot of little
allocations.  When I started programming for Palm OS, many devices only had
2-4 MB of memory and that sort of fragmentation was a bad idea.

My program no longer runs on 2MB Palm OS 3.0 devices, but it runs fine on 8MB
3.5 devices... maybe even 4MB devices.  If I use this alternate allocation
method, I know newer devices will probably be fine, but will I run into any
trouble on older devices?

Yes, older devices with less memory means users will necessarily have fewer
installed DBs since there is less space.  But there is no limit on DB size,
and it is certainly possible they have many tiny files they wish to install.

Am I worrying about nothing here?  :)


-- 
--John Gruenenfelder    Research Assistant, UMass Amherst student
                        Systems Manager, MKS Imaging Technology, LLC.
Try Weasel Reader for PalmOS  --  http://weaselreader.org
"This is the most fun I've had without being drenched in the blood
of my enemies!"
        --Sam of Sam & Max

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to