[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
passing C data to Scheme world
Regarding "Keeping C data structures in the Scheme heap".
Do we limit it to have simple structures that have no
pointers to outside resource? Otherwise we have some
issues:
- If we want to keep C structures that has pointers,
in Scheme heap, we need a hook to tell GC about it.
- Related to above; if we want to keep C structures that
has handles for extrenal resouces (externally allocated
memory, opened file descriptor, etc.), we need a kind of
finalization mechanism.
- Related to above; if we have circular reference across
resouces maintained in C world and resources maintained
in Scheme world, we need either have a mechanism that
"cancel" the finalization, or a hook to GC mark phase
that can check dependencies of C world.
Both seem for me very difficult to make portable across
various GC strategies.
I guess Java people have good knowledge about these issues.
--shiro