From e0bdc76b8b8bd0bd7b2c8ca5e5c9cef9ff911f75 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 9 Oct 2019 19:01:09 +0200 Subject: [PATCH] Add safepoint annotations to GC callbacks. (#33508) --- src/julia_gcext.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/julia_gcext.h b/src/julia_gcext.h index 415eda07be705..f931b1a4d9061 100644 --- a/src/julia_gcext.h +++ b/src/julia_gcext.h @@ -14,16 +14,16 @@ extern "C" { // Marking callbacks for global roots and tasks, respectively. These, // along with custom mark functions must not alter the GC state except // through calling jl_gc_mark_queue_obj() and jl_gc_mark_queue_objarray(). -typedef void (*jl_gc_cb_root_scanner_t)(int full); -typedef void (*jl_gc_cb_task_scanner_t)(jl_task_t *task, int full); +typedef void (*jl_gc_cb_root_scanner_t)(int full) JL_NOTSAFEPOINT; +typedef void (*jl_gc_cb_task_scanner_t)(jl_task_t *task, int full) JL_NOTSAFEPOINT; // Callbacks that are invoked before and after a collection. -typedef void (*jl_gc_cb_pre_gc_t)(int full); -typedef void (*jl_gc_cb_post_gc_t)(int full); +typedef void (*jl_gc_cb_pre_gc_t)(int full) JL_NOTSAFEPOINT; +typedef void (*jl_gc_cb_post_gc_t)(int full) JL_NOTSAFEPOINT; // Callbacks to track external object allocations. -typedef void (*jl_gc_cb_notify_external_alloc_t)(void *addr, size_t size); -typedef void (*jl_gc_cb_notify_external_free_t)(void *addr); +typedef void (*jl_gc_cb_notify_external_alloc_t)(void *addr, size_t size) JL_NOTSAFEPOINT; +typedef void (*jl_gc_cb_notify_external_free_t)(void *addr) JL_NOTSAFEPOINT; JL_DLLEXPORT void jl_gc_set_cb_root_scanner(jl_gc_cb_root_scanner_t cb, int enable); JL_DLLEXPORT void jl_gc_set_cb_task_scanner(jl_gc_cb_task_scanner_t cb, int enable);