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

Re: SOS. No garbage-collection on exit!



Quoting Sebastian H Seidel:
> When MzScheme exits, I would like to clear the instances of all
> formerly globally defined variables out of the Matlab-environment and
> it would be sooo easy if there was an exit-hook! Simply calling
> (collect-garbage).

I'm still a bit puzzled, because the default `exit' calls C exit(),
which means that some process somewhere is terminated in your current
setup.

But, in any case, the hook you want exists: scheme_exit is a global
variable in C that you can redirect to your own exit function.

> PS: I would like to learn about the behaviour of the
> MzScheme-garbage-collector because I'm rather unsure how to interact
> with it. Many functions that have to do with garbage-collection are
> not at all clear to me ...

I'm not sure where to point you at this time other than Inside MzScheme
(and this mailing list for specific questions).

Matthew