Hi everyone, I'm wondering if there are "smart pointers" like C++ in Julia. Calling C functions often require managing raw pointers allocated in the C functions. After allocating a pointer, I want to wrap it up with a smart pointer, which automatically frees the raw pointer when the smart pointer itself is removed with a garbage collector. As for pointers to an array, the `pointer_to_array` method seems to be suitable in this case ( http://docs.julialang.org/en/latest/stdlib/base/#Base.pointer_to_array).
More generally speaking, I want a functionality that is something like a destructor to manage resources more readily. Is it possible to call a function just before a Julia object is destructed? Thanks.