From a19c7b196e32fb419bd628da93aaa90a15e423b9 Mon Sep 17 00:00:00 2001 From: Diogo Netto <61364108+d-netto@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:23:31 -0300 Subject: [PATCH] remove unused jl_gc_alloc_*w (#55026) Closes https://github.com/JuliaLang/julia/issues/55024. --- src/gc.c | 24 ------------------------ src/jl_exported_funcs.inc | 4 ---- src/julia.h | 4 ---- src/runtime_intrinsics.c | 3 +-- 4 files changed, 1 insertion(+), 34 deletions(-) diff --git a/src/gc.c b/src/gc.c index 2b2c0f132f622..3c1c69b6493c2 100644 --- a/src/gc.c +++ b/src/gc.c @@ -4308,30 +4308,6 @@ JL_DLLEXPORT jl_value_t *jl_gc_allocobj(size_t sz) return jl_gc_alloc(ptls, sz, NULL); } -JL_DLLEXPORT jl_value_t *jl_gc_alloc_0w(void) -{ - jl_ptls_t ptls = jl_current_task->ptls; - return jl_gc_alloc(ptls, 0, NULL); -} - -JL_DLLEXPORT jl_value_t *jl_gc_alloc_1w(void) -{ - jl_ptls_t ptls = jl_current_task->ptls; - return jl_gc_alloc(ptls, sizeof(void*), NULL); -} - -JL_DLLEXPORT jl_value_t *jl_gc_alloc_2w(void) -{ - jl_ptls_t ptls = jl_current_task->ptls; - return jl_gc_alloc(ptls, sizeof(void*) * 2, NULL); -} - -JL_DLLEXPORT jl_value_t *jl_gc_alloc_3w(void) -{ - jl_ptls_t ptls = jl_current_task->ptls; - return jl_gc_alloc(ptls, sizeof(void*) * 3, NULL); -} - JL_DLLEXPORT int jl_gc_enable_conservative_gc_support(void) { if (jl_is_initialized()) { diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index f52ef7f794442..a98158f3d3e5e 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -152,10 +152,6 @@ XX(jl_gc_add_ptr_finalizer) \ XX(jl_gc_add_quiescent) \ XX(jl_gc_allocobj) \ - XX(jl_gc_alloc_0w) \ - XX(jl_gc_alloc_1w) \ - XX(jl_gc_alloc_2w) \ - XX(jl_gc_alloc_3w) \ XX(jl_gc_alloc_typed) \ XX(jl_gc_big_alloc) \ XX(jl_gc_big_alloc_instrumented) \ diff --git a/src/julia.h b/src/julia.h index 1f85f06dd35dc..096b01ad23de2 100644 --- a/src/julia.h +++ b/src/julia.h @@ -998,10 +998,6 @@ JL_DLLEXPORT void jl_gc_add_ptr_finalizer(jl_ptls_t ptls, jl_value_t *v, void *f JL_DLLEXPORT void jl_gc_add_quiescent(jl_ptls_t ptls, void **v, void *f) JL_NOTSAFEPOINT; JL_DLLEXPORT void jl_finalize(jl_value_t *o); JL_DLLEXPORT jl_weakref_t *jl_gc_new_weakref(jl_value_t *value); -JL_DLLEXPORT jl_value_t *jl_gc_alloc_0w(void); -JL_DLLEXPORT jl_value_t *jl_gc_alloc_1w(void); -JL_DLLEXPORT jl_value_t *jl_gc_alloc_2w(void); -JL_DLLEXPORT jl_value_t *jl_gc_alloc_3w(void); JL_DLLEXPORT jl_value_t *jl_gc_allocobj(size_t sz); JL_DLLEXPORT void *jl_malloc_stack(size_t *bufsz, struct _jl_task_t *owner) JL_NOTSAFEPOINT; JL_DLLEXPORT void jl_free_stack(void *stkbuf, size_t bufsz); diff --git a/src/runtime_intrinsics.c b/src/runtime_intrinsics.c index 844a5ca8338c7..2d99521a82802 100644 --- a/src/runtime_intrinsics.c +++ b/src/runtime_intrinsics.c @@ -513,8 +513,7 @@ JL_DLLEXPORT jl_value_t *jl_cglobal(jl_value_t *v, jl_value_t *ty) void *ptr; jl_dlsym(jl_get_library(f_lib), f_name, &ptr, 1); - jl_value_t *jv = jl_gc_alloc_1w(); - jl_set_typeof(jv, rt); + jl_value_t *jv = jl_gc_alloc(jl_current_task->ptls, sizeof(void*), rt); *(void**)jl_data_ptr(jv) = ptr; JL_GC_POP(); return jv;