running directly from RAM on wince?

Noel J. Bergman noel at devtech.com
Tue May 29 05:12:46 UTC 2001


> [As] I see it you should be able to basically map everything in, then run
it.

That was my thought.  :-)

> The only issue remaining is that one must never quit without
> saving the image.  In effect, the image would always be an
> up-to-date memory snapshot [...]

My thought was that the code should do everything currently done, except for
the actually writing of the image data to the file, since it is already
there.

The image reading code changes to handle the header differently, as does the
image writing code, and we don't actually have to do the block read/write.
Otherwise, I was thinking that the same behaviors would be performed.

How does that sound to you?

>> I do note that to grown/shrink the allocation, we'd have to close it,
>> allocate a new mapping, and re-map.
>  [Not] a problem as long as CE doesn't commit mapped memory [...]

On Windows CE, when you call CreateFileMapping for a size greater than the
size of the file, the file is expanded to the full size of the requested
space; an error is returned if there is insufficient room.  This is done to
ensure the available of the backing store.  I was planning to call
SetEndOfFile to truncate the space after closing the file.

	--- Noel

CreateFileMapping:
http://msdn.microsoft.com/library/wcedoc/wcesdkr/_wcesdk_win32_createfilemap
ping.htm

SetEndOfFile:
http://msdn.microsoft.com/library/wcedoc/wcesdkr/_wcesdk_Win32_SetEndOfFile.
htm





More information about the Squeak-dev mailing list