running directly from RAM on wince?

Noel J. Bergman noel at devtech.com
Tue May 29 00:49:30 UTC 2001


> Just for clarification, do I understand you correctly,
> that want to use memory mapped files for basically
> providing a swap space and an address space extension?!

There are two benefits:

 (1) Memory mapped files make the most of limited RAM;
     you don't need TWO copies of the data.
 (2) Memory mapped files can simulate backing store

> [Your] key problem will be where exactly the file gets
> mapped into memory - there is a fundamental assumption
> built into the VM that old space comes before young space.

I understand this issue, Andreas.  :-)  As I read the code (and I have been
reading and re-reading), the entirety of the Squeak object space is
allocated by sqAllocateMemory(), which is called by
Interpreter>>readImageFromFile:HeapSize:StartingAt: during startup.  The
image file, skipping the header, is then read into the begining of this
heap.  Glossing over important details, my change is roughly analogous this:

   sqAllocateMemory -> CreateFileMapping
   sqImageFileRead -> MapViewOfFile

In other words, the amount of available memory is established by
CreateFileMapping, and the actual mapping of the file into that memory is
performed by MapViewOfFile.  [This is just for concept; I would not
implement the change by re-implementing sqAllocateMemory and
sqImageFileRead, since they are not independent in the memory mapped
implementation.]

> [You] could be pretty much okay; all that's needed is to
> "bridge the gap" between old and young space during GC

What gap?  There is no gap.  The whole point is to give Squeak exactly what
it expects: a single, contiguous, allocated region for the object space.

> One thing that sounds strange is that CE only gives you a
> 32MB address space. Is this still true?! I would've guessed
> that if there's handling of memory mapped files and all that
> stuff it should be beyound the 32MB barrier by now...

I did mention something in my prior message that I glossed over too quickly.
Each process under Windows CE gets a 32 MB slot.  The address space used for
memory mapped files is not part of the 32 MB slot; it is from another region
of memory entirely.  You might want to check the 3rd link I put in the prior
message.  You'll find a layout of the WinCE memory architecture; pictures
and everything.

	--- Noel





More information about the Squeak-dev mailing list