[plt-scheme] Cooperating with 3m

From: mathematica at citiz.net (mathematica at citiz.net)
Date: Mon Jan 2 13:33:14 EST 2006

I'm adding 3m support to mrmathematica according to <Inside PLT MzScheme>.

Now I have the following questions. 

1. <3.1.1  Tagged Objects> says that for a new type of object, I need to
call scheme_malloc_tagged to allocate memory and call GC_register_traversers
to register size, mark, and fixup procedure for my type. But my type 
has no point to Scheme_Object in it. So could I still allcate it by
scheme_malloc_atomic (instead of scheme_malloc_tagged) and not register

2. For objects used only in C (such as C strings), I just need to use 
calloc and free to allocate memory for them. Right?

3. When compiling, I got the following error message:

Error [ARITH] 53 in ml.c: suspicious arithmetic, LHS ends arg.

line 53 is 

	if (lp == (MLINK)0)

lp is a variable previously defined as:
	MLINK lp;

The reason of the error is mentioned in <3.1.3  Local Pointers and mzc>. 
Could anyone help to change my code so that I can avoid the error? Thanks.

BTW1: I changed the code into:

	lp0 = (MLINK)0;
	if( lp == lp0)

But still gets the same error message (line number is the first line: lp0 = (MLINK)0;).

BTW2: MLINK is a data structure defined by mathematica and I can't (at least 
now) tell what it is exactly (no source code provided).

4. <1.2  Embedding MzScheme into a Program>: "MzScheme3m can be embedded 
the same as MzScheme, as long as the embedding program cooperates with the 
precise garbage collector as described in section 3.1." But no explicit 
instruction of how to build such a program is given.

Chongkai Zhu

Posted on the users mailing list.