in reply to interfacing with a boehm-gc library from XS
I don't have a specific solution for you, just some observations.
The segfaults you see are almost certainly from double-freeing chunks of memory. Perl has its own memory management - in two flavors. One uses native malloc/free, the other a version provided by perl. Both are closely tied in to how perl provides storage to variables and and decides when it can take it back.
Your specific questions say you already appreciate the trouble this may cause.
You will probably need to carefully work both mm models in parallel, with two mallocs, two frees, and a separate memory arena for libgc-managed storage. You'll need to keep track of which pointers come from which. The perlguts and perlapi docs will help a lot with the perl end.
This kind of problem often occurs with libraries for complex data structures, but I've never tried hooking up to a whole different memory managment scheme. Good luck!
After Compline,
Zaxo
|
|---|