Squeak DisplayScreen Bitmap Stationary?

Marcel Weiher marcel at metaobject.com
Mon Aug 19 14:35:00 UTC 2002


On Monday, August 19, 2002, at 01:41  Uhr, Ian Piumarta wrote:

> On Mon, 19 Aug 2002, Marcel Weiher wrote:
>
>> will Squeak's DisplayScreen bitmap be moved around during garbage
>> collection?
>
> Yes.
>
>> If so, is there a way to be informed of this?
>
> Indirectly, yes.
>
> Just check the dispBitsIndex that's passed to ioShowDisplay.  If it 
> isn't
> the same as the previous one then it's (err...) moved (duh... ;-).

Well, yes, but I might have to know about this asynchronously, that is, 
not when Squeak thinks it needs to display something, but as soon as it 
does move.


>> I think there is a way of using the DisplayScreen's bits directly for
>> display (in case they match), without copying them around multiple
>> times, but I think I'd need to know when the address changes.
>
> Take a look at sqXWindow.c which uses the contents of Display's Bitmap
> directly whenever it can.

I will take a look at that.

>  The static variable stDisplayBitsIndex in
> ioShowDisplay hangs on to the most recently known address of that 
> object,
> and the global stDisplayBitmap is either the bits in the real Bitmap or
> memory allocated outside the image if for some reason we can't reuse 
> the
> Bitmap directly.

OK.


> There are a few details to pay attention to, e.g.: see redrawDisplay()
> (which extracts the Bitmap from the oop returned by displayObject(), a
> function covertly imported from Interpreter) and ioShowDisplay() (which
> has to make sure external code never tries to free() the display memory
> e.g., when X11 destroys an XImage that's pointing directly at the 
> Bitmap
> inside Display).

Thanks,

Marcel




More information about the Squeak-dev mailing list