Memory management and low-level free/malloc interaction

I’m trying to make some sense of Memory leak when destroying a surface · Issue #225 · JuliaGraphics/Cairo.jl · GitHub and CairoScript should probably not use finalizers · Issue #215 · JuliaGraphics/Cairo.jl · GitHub which both seems to be related to julia and ccall-able. Different problems on different platforms and hard to reproduce and test.

Is there documentation (also what-to-read in julia code) about the interactions?