Squeak on Palm OS 5?

Tommy Thorn thorn at meko.dk
Tue Oct 8 20:25:04 UTC 2002


Joern Eyrich wrote:

>As far as i know, these limits are still there, slightly less than 64k for a chunk of the dynamic heap. I remember someone proposed to allocate a big chunk of the storage heap instead, which doesn't have these restrictions, but then the storage heap is write protected for normal applications or something like that.
>

That sounds like the rules for the "usual" PalmOS.  Disappointing that 
it hasn't changed. To give a little more detail, the dynamic heap (the 
Unix BSS segment) is limited to slightly less than 64k, however the 
static data and stack is much less. Recent GCC's have enabled 
practically unlimited code space.

So programs needing more space _has_ to allocate records in the 
database. These can be locked down so you can get a pointer to them and 
treat them as read only memory.  The maximum size of a record is 
slightly less than 64k, but successfully allocating such a big record 
depends on how fragmented the heap is. The big problem of course is 
updating. The official and santioned way is to use a database write 
syscall which is obviously fairly expensive.  There is a way around 
that. The memory protection can be (globally) disabled enabling 
read/write access to the whole database. Only this is a scary thing to 
do as it's very easy for an otherwise innocent bug to cause database 
corruption for other unrelated applications. And them, even if you do 
this, you'll still not be able to have a big consecutive piece of 
memory, but only chunks scattered around the memory space.

Palm was really short sighted when they defined PalmOS.

/Tommy





More information about the Squeak-dev mailing list