Stack-allocating wrapped C++ objects

This is somewhat off-topic, but I don’t think you can reasonably rely on the finalizer to delete the object. In my experience these objects tend to live in memory for a lot longer than you expect because the Julia GC doesn’t know how large they are.

Therefore I think you should prefer manually managing the memory or avoiding using Ptr{Void} as a field type. In my case I was able to do the latter, but I think I pay for it by doing extra copies when moving data between Julia and C++.

See for reference