C struct garbage collection not run frequently enough

Ah right, mixed it up with GC.enable :person_facepalming:

If the library doesn’t provide a way to use a custom malloc, it’ll be difficult to just drop jl_malloc in there.


One thing I’m wondering about, looking at the struct definition, is why you’re wrapping a pointer? Ordinarily, I’d make the RTPSA struct mutable (to communicate to julia that it has a stable address) and just use that directly, perhaps attaching the finalizer there, retrieving the object pointer through pointer_from_objref (which should be safe here, since the object is alive in the finalizer). Why the additional indirection?