From Embedding Julia · The Julia Language, it seems if I want a long-lasting object not to be collected by the Julia garbage collector when embedding Julia in C++, I need to store that object in an IdDict bound to a global Julia variable. If the object is immutable, then I can’t just store it directly, I need to wrap it in a RefValue{Any}. My question is:
- Does a jl_array_t* created by jl_ptr_to_array_1d also need to be wrapped in a RefValue{Any} when the element type is immutable?
- Does a jl_sym_t* need to be wrapped in a RefValue{Any}?
- Does a jl_value_t* that points to a type (e.g. jl_eval_string(“MyType”)) need to be wrapped in a RefValue{Any}?