From 1dbf10e16e7e6ef86811f3b2ad2094c1c2b1b33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Thu, 24 Oct 2024 15:06:30 +0200 Subject: [PATCH 1/2] Adjust julia gc to `jl_gc_new_weakref` no longer being exported --- src/weakptr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/weakptr.c b/src/weakptr.c index 8d27774971..0ed21ce3c4 100644 --- a/src/weakptr.c +++ b/src/weakptr.c @@ -151,7 +151,7 @@ static inline void SET_ELM_WPOBJ(Obj list, UInt pos, Obj val) return; } if (!IS_BAG_REF(ptr[pos])) { - ptr[pos] = (Bag)jl_gc_new_weakref((jl_value_t *)val); + ptr[pos] = (Bag)jl_gc_new_weakref_th(jl_get_ptls_states(), (jl_value_t *)val); jl_gc_wb_back(BAG_HEADER(list)); } else { From 4207a1b60da36fd2d06ca7431fa3d2beffb0b158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Thu, 24 Oct 2024 16:14:25 +0200 Subject: [PATCH 2/2] Add include --- src/weakptr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/weakptr.c b/src/weakptr.c index 0ed21ce3c4..c277eeee05 100644 --- a/src/weakptr.c +++ b/src/weakptr.c @@ -40,6 +40,13 @@ #ifdef USE_JULIA_GC #include "julia.h" #include "julia_gc.h" +#include // for jl_get_ptls_states + +#if JULIA_VERSION_MAJOR == 1 && JULIA_VERSION_MINOR == 7 +// workaround issue with Julia 1.7 headers which "forgot" to export this +// function +JL_DLLEXPORT void * jl_get_ptls_states(void); +#endif #endif #define RequireWPObj(funcname, op) \