[mercury-users] Tcl/Tk

Peter Wang wangp at students.csse.unimelb.edu.au
Sat Jun 16 10:41:54 AEST 2007


On 2007-06-15, Tomas By <tomas at basun.net> wrote:
> On Thu, June 7, 2007 00:46, Ralph Becket wrote:
> > Compile in a debugging grade then run the program to completion under
> > mdb.  [...]
> 
> Hello again,
> 
> I have changed things around in the application, from using a few big
> `map's to using many small ones, which made a huge difference. Earlier it
> was Win 3.1 style interaction (Move the mouse pointer and the app crashes.
> will I reach the save menu before it crashes? Maybe if I move really
> slowly. No, better hurry...) but now it crashes only occasionally.

My guess is that the garbage collector prematurely collects the closures
passed to Tcl.  Perhaps Tcl stashes pointers somewhere the garbage
collector cannot see them.  Changing the definitions of malloc and
realloc in mtcltk.m to use GC_MALLOC_UNCOLLECTABLE instead of GC_MALLOC
seems to help on the calc example.

Peter

--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list