On 11/29/05, Thomas Chust <[EMAIL PROTECTED]> wrote:
> Hello,
>
> a small question occurred to me which I could not solve using the
> CHICKEN manual: If I declare a callback function using define-external
> and give a parameter a type of c-string* will the string passed in
> from C be deallocated after being copied into garbage collected
> memory?
>
This is correct.
(define-external (foo (c-string* x)) void
(print "foo"))
(set! foo
(##core#foreign-callback-wrapper
'foo
'""
'void
'(c-string*)
(lambda (x3)
(let ((x4 (##sys#peek-and-free-c-string x3 '0))) ; <---
(let () (print '"foo"))))))
cheers,
felix
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users