[plt-scheme] 3m defaults to --enable-account

From: Adam Wick (awick at cs.utah.edu)
Date: Mon Jan 19 15:49:25 EST 2004

At Sun, 18 Jan 2004 14:13:43 -0500, Ittai Balaban wrote:
> I was wondering, in the midst of this debate -- is it harder to use 3m
> when embedding C extensions in mzscheme? 

At the moment, yes, although how much more difficult depends on the 
particular extension. I'm working on fixing this, but it'll be awhile
yet before I have a prototype suitable for public use.

There are two separate problems. First, if your extension allocates 
new structure types you want collected, these structures must be 
registered with the collector. This registration gives the collector
functions for accurately determining heap references. Currently, this
must be done by hand.

Second, any function call which might lead to an allocation may cause a
garbage collection. Since the now-default 3m collector moves objects around
on every collection, temporary variables surviving the call must be moved
to use the new locations should a collection happen. Currently, there is
a scheme script that automatically does this conversion in many cases,
although it tends to assume a programming style which may not be true of
your code. 

I'm working on better tools for both problems at the moment.

The OpenSSL collection creates a 3m version of the openssl extension, and
is a good example of both processes. See the 'GC_register_traverser' call
in mzssl.c (and the functions it references) for more information on the
first, and the pre-installer.ss file includes the build process using 
the transformer script, xform.ss


Posted on the users mailing list.