On 10/8/06, John Janecek <[EMAIL PROTECTED]> wrote:
(define bv (string->byte-vector "some sort of string"))
I then have to pass bv to a C function
The C function just reads the data.
But it requires that the data does not move
Does byte-vector payload move ?
or do I need to use static-byte-vector ?
Yes, when a garbage collection occurs, the string contents
may move to a different address. GC's only occur
during callbacks to Scheme, or when you store (Scheme) strings
in C globals and access them during separate invocations of C
code.
A static byte vector would indeed be a solution, the contents do not
move, but you have to release them manually, of course.
cheers,
felix
--
http://galinha.ucpel.tche.br:8081/blog/blog.ssp
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users