I’m working on a project in haxe, using the cpp backend. The program’s talking to an sqlite database via a hand-rolled extern interface, and I’ve just discovered a really unpleasant issue where sometimes the contents of some of the program’s data structures will vanish, being replaced with nulls. These seems to correlate with garbage collections, and adding calls to
cpp.vm.Gc.compact() will provoke it earlier.
I’m guessing there aren’t any known bugs in the cpp garbage collector on Haxe 4.1.3, amd64 Debian Linux?
If that’s the case, then the only possible culprit is my sqlite extern interface. As the cpp extern stuff is almost entirely undocumented I’ve had to guess at a lot of it, so I suspect that I’m doing something wrong and confusing the garbage collector, causing it to think that same objects are garbage when they’re actually live.
Could someone have a quick look and sanity check it, please, and tell me if there’s anything obviously wrong with it? I’m out of ideas, here. It’s 200 lines of pretty simple code: each native object is referenced by a
Pointer<SomeExternClass>, and owned by a Haxe class which extends
(Or I could paste it here if people think it’s small enough.)