Neil,
I have "finished" a beta virtual memory manager for the Palm which pages
dynamic RAM to the disk. What this means is that you can allocate more
RAM that physically available (I page it to storage RAM), but you can
only lock down handles if there is enough dynamic RAM to hold what's in
the handle. It may help you in your memory problems as far as storage
size goes.
The docs aren't written yet (been a busy week so far-although the params
are identical to the Palm API calls) and I've not done enough stochastic
testing of the manager yet. But I'm happy to entertain beta users if
you're interested.
The performance of VMMHandleNew sucks--it takes about 25-30 ms per
allocation. This is tied almost directly to DmNewRecord performance.
I'm currently investigating ways to improve this or amortize the cost
over a number of VMM operations. Other operations take much less time.
I tried to mimic the Palm API for handles exactly (pointer API is in
works--almost done) so that it is familiar for current programmers.
To use the VMM, the code looks like this:
VMMHandle handle; // VMM memory handle,
NOT synonymous with VoidHand in Memory manager API
VoidPtr ptr;
handle = VMMHandleNew(100); // RAM is allocated in
paged area
ptr = VMMHandleLock(handle); // RAM is allocated from
dynamic RAM and paged data is copied from paged area to dynamic area
// Use pointer like you would any other pointer
VMMHandleUnlock(handle); // RAM is copied from
dynamic RAM to paged area--dynamic RAM is freed
VMMHandleFree(handle); // RAM in paged area is freed
// more code...
Let me know what you think so I can try to put something together today
for you.
Here to help...
Mike
> -----Original Message-----
> From: Neil Davidson [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, March 02, 1999 11:39 AM
> To: [EMAIL PROTECTED]
> Subject: More memory problems.....
>
> Hi again,
>
> I'm sorry to still be asking about this but I am at the end of my
> tether.
>
> I have tried to change the variables of the class to be dynamically
> allocated but this wont work, the code I tried was :
>
> CharPtr name;
> ....
> name = (CharPtr)MemPtrNew(StrLen{in_name));
> StrCpy(name, in_name);
>
> Any ideas why that doesn't work?
>
> I have also changed the array declaration from :
>
> Film filmArray[Max_Film_Num];
>
> to :
>
> Film * filmArray = new Film[Max_Film_Num];
>
> The app still crashes when Max_Film_Num is any greater that 13.
>
> Is there ANYTHING I can do to increase the size of this data
> structure? I
> have had a look at some DB code and it makes no sense to me, it really
> is
> a last resort.
>
>
> Thanks again for listening,
>
> Neil
>