diff --git a/include/jlcxx/array.hpp b/include/jlcxx/array.hpp index ee287ef..5c3eab8 100644 --- a/include/jlcxx/array.hpp +++ b/include/jlcxx/array.hpp @@ -133,10 +133,14 @@ class Array JL_GC_PUSH1(&m_array); const size_t pos = jl_array_len(m_array); jl_array_grow_end(m_array, 1); - jl_value_t** data = jlcxx_array_data(m_array); jl_value_t* jval = box(val); +#if (JULIA_VERSION_MAJOR * 100 + JULIA_VERSION_MINOR) >= 111 + jl_value_t** data = jlcxx_array_data(m_array); data[pos] = jval; - jl_gc_wb(m_array, jval); + jl_gc_wb(jl_array_owner(m_array), jval); +#else + jl_arrayset(m_array, jval, pos); +#endif JL_GC_POP(); }