[plt-scheme] precise GC example?

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Sat Dec 29 12:39:41 EST 2007


tom sgouros wrote:
> Chongkai Zhu <czhu at cs.utah.edu> wrote:
>
>   
>> All I can suggest now is to carefully read section 3 of inside
>> mzscheme manual, especially "3.1.4 Guiding mzc --xform".
>>     
>
> Thank you.  I've been reading that section as closely as I can, and yet
> I still think my life would be easier if I could find an example of how
> it's done.  Soon, of course, I'll have an example, but if I could learn
> from someone else's experience, I'd have mine sooner.
>
> Also, my question about testing is not answered in that section.  Do I
> know that I've done it right if I get it to run once without segfaults?
> Do I need to test it more than that to be certain it will always run
> properly?  Any suggestions or advice there would be welcome.
>
> Thanks,
>
>  -tom
>
>   

For me, I use "mzc --xform" to do the job, and my code happen to (or, I 
managed to make it) meet all the limitations described in section 3.1.3. 
So I know I do it correctly.

A rule I used: if the point is managed by Scheme (i.e., with 
scheme_malloc), I use xform to deal with it. If the point is managed by 
C/yourself (i.e. with malloc/free), I warp that part of the code with

#ifdef MZ_PRECISE_GC
XFORM_START_SKIP;
#endif

and

#ifdef MZ_PRECISE_GC
XFORM_END_SKIP;
#endif

Hope that helps.


Chongkai




Posted on the users mailing list.