Summary

GC in callbacks will invalidate references to Scheme data used in "crunch" code

Metadata

Description

When code compiled with `crunch` manipulates number-vectors or strings allocated in Scheme, then a callback is likely to trigger a GC, which will move those data-structures, rendering existing references to them on the crunch side invalid.

It may be possible to use a special vector/buffer type for data-objects passed from Scheme to crunch.

Changes and comments

[2010-05-22 14:24:06 UTC] felix changed status from new to closed

[2010-05-22 14:24:06 UTC] felix set resolution to wontfix

[2010-05-22 14:24:06 UTC] felix wrote:

Replying to felix: > When code compiled with `crunch` manipulates number-vectors or strings allocated in Scheme, then a callback is likely to trigger a GC, which will move those data-structures, rendering existing references to them on the crunch side invalid.

This also applies to normal foreign code that uses callbacks, so this is not a problem with `crunch`, but with the question of how to handle such data in general.