On 17-Apr-09, at 12:41 AM, lowly coder wrote:
I probably deserve to be shot for this, but ...
I need this only when wrapping a single C call, and AFAIK, the gambit GC does not run while I'm inside a C function.
Does gambit support things like:
(disable-GC) (... unsafe call involving taking int* of a u32-vector) (enable-GC)
Thanks!
No it doesn't because just about everything (including function calls) can allocate heap memory, and cause a GC. However, currently the GC does not run concurrently with the main program, so it is possible (currently) to pass a (possibly) movable u32vector to a c-lambda, as a "scheme-object", and then cast that in the C code to a ___U32* using the ___BODY macro. It shouldn't be too hard to simplify all of this with a c-define-type with scheme-to-c and c-to-scheme converter functions.
Too late for me to do that now. Jérémie can you help?
Marc