[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #_DrawPicture and the mac heap



>Sub:    #_DrawPicture and the mac heap
> 
>> From: lynch@aristotle.ils.nwu.edu
>> I have reason to believe that if DrawPicture is called when
>> the mac heap is too small for the picture to be drawn, the
>> various shenanigans that go on
>> to move the mac/lisp heap divider cause a crash...
> 
>The Mac heap can move during the _DrawPicture call, but that
>routine shouldn't be allocating any heap memory for drawing.
>I always _MoveHHi and _HLock the handle to my picture before the
>call (and _HUnlock immediately afterwards). How are you able to
>tell the divider (assuming these 2 abut) is being moved if the
>Mac crashes before it's done?
> 
>_Steve
> 
>[ Note to the MCL team: If it's not too late, please remove all
>  shenanigans from MCL 2.0 final before shipping it. Thanks! ]
> 
Well, it only crashes when the amount of space left in the mac heap is
small.  

If I do a (#_DisposeHandle (#_NewHandle 2400000)) before drawing the pict,
everything is fine.

NOTE:  2400000 is only chosen as half the available space.  Probably a
number equal to twice the size of the handle to be drawn would be
sufficient, if my memory of what IM says is correct.
"TANSTAAFL" Rich lynch@ils.nwu.edu