[gambit-list] Getting char*, uchar*, short*, unsigned short*, ...

Marc Feeley feeley at iro.umontreal.ca
Fri Apr 17 00:47:11 EDT 2009


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




More information about the Gambit-list mailing list