[plt-scheme] precise GC and the embedded MzScheme C API

From: Adam Wick (awick at cs.utah.edu)
Date: Mon Jun 27 12:51:13 EDT 2005

On Jun 23, 2005, at 5:27 PM, Jim Blandy wrote:
> Adam Wick <awick at cs.utah.edu> writes:
>> On Jun 23, 2005, at 10:57 AM, Jim Blandy wrote:
>>> Have you thought about what sort of interface you'd like an embedded
>>> MzScheme to provide to third-party C code when it's using the precise
>>> GC?  Are you going to have end users run gc2/xform.ss on their code?
>> Yes and sort of.
>> There will be a successor to xform coming, hopefully, sometime this
>> year. It will not only do the xform stuff, which adds precise GC
>> information to the C stack, but also have a tool for generating
>> functions to mark and repair your structures, as well as to add
>> tagging information when you allocate structures (including your
>> own structures).
> Sounds great!  Are you going to try to support multi-threaded programs
> where the threads can't be trusted to reach safe points from time to
> time?

No. Sorry. But that's not only a tricky thing to do, it's been done (at
least partially) before. Maybe in that distant, dreamlike future when
I've graduated and I get to spend lots of time on beaches with colorful
drinks with little fruit on sticks.

> (I can see why templates would be a challenge: the C++ compiler is
> essentially producing entirely new code as it does type elaboration,
> which your tool doesn't get a chance to modify.  But C++ is capable of
> doing a lot of the annotation itself, so tools like xform are less
> critical there.)

Actually, in this particular case, templates cause problems, but they
don't cause the level of problems that they usually do. Still, one has
to determine answers to the questions "Does this template argument
ever get instantiated with a pointer? With a non-pointer?" which is a
surprising amount of work.


Posted on the users mailing list.