Hello,
How to properly call a Julia function from C that returns a value(could be array, tuple, POD, string).
When I try to do that, the program segfault during the jl_call(...)
before I can call a jl_gc_push on the jl_value_t*
returned by jl_call
. I assume it’s an issue of garbage collection not properly handled except all the function argument are C-allocated Array (si the GC shouldn’t trigger at all).
I also have a question regarding Tuple construction.
I read on this forum API reference for Julia Embedding in C - #9 by yuyichao that there is tuple function, but can’t find any documentation on it.
What I usually end up doing is something like this : jl_eval_string("(a:124, b: 33.33)")
, but unless I’m mistaken, it means there was memory allocation and I have to call jl_gc_push
.
Is there a way to create a Tuple from an already allocated buffer ?