[Vm-dev] mac os-x 64bit vm update

John M McIntosh johnmci at smalltalkconsulting.com
Fri Nov 20 07:42:10 UTC 2009

I've check in the latest changes to isqueak.org. 

At the moment, I've added the mouse up/'down/drag for three button mice. I have not added scroll wheel support yet. 
I've added the basic keyboard key down, char, up for keyboard interaction. However this does not include deadkey support or cmd-key pass thru. 

(a) Cursor is not not updated correctly in 64bit mode. 

Tomorrow I hope to resolve issues with the keyboard logic. 

Today I spend many hours figuring out that if you create a CGImageRef using a data provider, the data provider is *NOT* actually asked for 
the data which would toss bytes from the Squeak oops in ioShowDisplayOnWindow at creation time. 
Rather the bytes are only read when the CGImageRef is used for drawing. 

Now in the past once a CGImageRef was setup it appeared Apple used a COW VM trick to ensure the data was not mutable. 
However this seems to have changed again in 10.6.  We don't experience the problem in the old logic because we do a  context sync which 
seems to move the data into the graphics engine after we create the CGImageRef. 

The solution is to copy the data from squeak into a malloced area then free after usage. 

At the moment the drawing pattern I am using is to place draw requests from ioShowDisplayOnWindow onto a FIFO queue, then on the 
ioForceDisplayUpdate we send the drawing atoms to the drawing queue and invalidate the combined window area.   Or if 20 milliseconds 
pass after a ioShowDisplayOnWindow and no ioForceDisplayUpdate we then do an explicit ioForceDisplayUpdate to flush the drawing. 

The desire is to flush data to the screen on the ioForceDisplayUpdate boundary, not on each ioShowDisplayOnWindow.

The other interesting thing is that I have squeak running as a background pthread versus on the main UI thread. We'll see how that works 
out since it appears to be more tolerant than in past years.  This model change results in an idle Squeak using 50% less CPU than before 
since it's sleeping, and the UI is sleeping. Previous versions would have to poll the UI, which was expensive. 

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