Re: [Chicken-users] What happens to a (non-simple) Scheme object sent to a foreign function?

2007-02-05 Thread Tony Sidaway
On 2/5/07, felix winkelmann [EMAIL PROTECTED] wrote: Another option would be to create a GC root (CHICKEN_new_gc_root) and keep it on the C-side (you have to pass the argument string as a scheme-object, then create the GC-root from it). Later, you can access the gc root (CHICKEN_gc_root_ref) and

Re: [Chicken-users] What happens to a (non-simple) Scheme object sent to a foreign function?

2007-02-04 Thread felix winkelmann
On 2/4/07, Thomas Christian Chust [EMAIL PROTECTED] wrote: the address of the C function wrapping the define-external'ed Scheme procedure is unproblematic, because it will never change. The pointer to the C string data may become invalid, though, once the program returns from the library call.

[Chicken-users] What happens to a (non-simple) Scheme object sent to a foreign function?

2007-02-03 Thread Tony Sidaway
I'm sending a Scheme string to a foreign (C) library as a c-string. I also send it the address of a Scheme procedure created as define-external--this address is sent as a c-pointer. Later on I call a safe-foreign-lambda which will use the Scheme function whose address I sent it as a callback,