[Vm-dev] [Fwd: Image file loading]

John M McIntosh johnmci at smalltalkconsulting.com
Wed Jan 20 02:37:53 UTC 2010


On 2010-01-19, at 6:04 PM, Igor Stasenko wrote:

> 
> 2010/1/20 Andreas Raab <andreas.raab at gmx.de>:
>> 
>> Igor Stasenko wrote:
>>> 
>>> Platform code invoking:
>>> 
>>> sqReadImageFrom(void *object).
> 


Ok, the other thing that goes on here is that I mmap the start of the bytecodes to 500MB on os-x and the iPhone

 usqInt sqAllocateMemoryMac(sqInt minHeapSize, sqInt *desiredHeapSize, FILE * f,usqInt headersize)

the headersize that's passed in helps me to adjust where the bytecode start is

This is done so that I can avoid swizzling all pointers between restarts on the machines, on os-x and the iPhone byte codes start at 500MB... 

Note this becomes more interesting if you can avoid swizzling all the pointers at startup time on FLASH based devices so 
you don't load the entire image into RAM.   In my iPhone work for wikiserver the image is 1932 pages, but I only need to load 806 pages
into ram to get the first page up. {Yes of course I had to remove the crappy allInstances in various places at startup time}.  If you check 
the pointer swizzle doesn't do anything if the old start of memory offset matchs the new start of memory offset. 

BTW Loading the extra 1100 pages actually *is* measured in seconds, so the gain is important. 

--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================






More information about the Vm-dev mailing list