[squeak-dev] Squeak Carbon OS-X VM 3.8.19beta1U ships
John M McIntosh
johnmci at smalltalkconsulting.com
Wed Oct 29 01:31:35 UTC 2008
This VM has a number of fundamental changes and can be found
via ftp or my idisk at http://www.smalltalkconsulting.com/squeak.html
(a) I have changed how image files are read.
Users should verify the VM still will load and work with their current
images on their current systems. I have tested with macintel on 10.5.x
and powerpc on 10.4.x but have NOT tested on a 10.3.x powerpc system,
if some 10.3.x user could do that it would be appreciated.
(b) I no longer cwd (change working directory) at startup time to the
VM directory, and I added a change so if the image name is for example
Squeak.image we attempt to find that in the VM directory. This change
*should* enable the ablility to launch a VM and image and startup file
from a command line using relative file paths, versus having to give
Users are welcome to test and confirm this feature works as expected
with relative and absolute paths for the image and startup file.
Memory allocation background:
In the past we have read the image file into a pre-allocated chunk of
memory allocated via mmap, now I have changed to a more complicated
but faster method of reading which then allows us to someday depending
on your VM to avoid re-swizzling pointers for an image that is
launched on a unix, windows, or iPhone since all oops should start on
the 500MB boundary.
What happens is we mmap the image file with copy on write mmap into a
segment of memory starting at a real address of 500MB (500*1024*1024),
the next virtual memory page follow the size of the file then is
anonymously mmap upto the maximum memory size choosen for the
implmentation. In this case we allocate 512MB of memory which is a
settable option in the info.plist.
Because of mmap differences between operating systems, and versions of
operating systems I cannot say if this will work on your favourite
device, but it does seem to work on os-x 10.4 & 10.5 for powerpc and
macintel, plus on iPhone 2.x.
Post loading we check to see if the memory start location is the same
as the memory start location when the image was saved. If not then we
adjust all oops pointers by the difference in addresses. If the saved
image was at the 500MB boundary then we do not need to walk all the
oops to swizzle pointers, this saves some CPU cycle and becomes
important on slow devices like the iPhone, or when we want to use
Squeak as a scripting engine and expect really fast startup.
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
More information about the Squeak-dev