Skip to content

Commit e0bdc76

Browse files
maleadtKeno
authored andcommitted
Add safepoint annotations to GC callbacks. (#33508)
1 parent d913db4 commit e0bdc76

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/julia_gcext.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ extern "C" {
1414
// Marking callbacks for global roots and tasks, respectively. These,
1515
// along with custom mark functions must not alter the GC state except
1616
// through calling jl_gc_mark_queue_obj() and jl_gc_mark_queue_objarray().
17-
typedef void (*jl_gc_cb_root_scanner_t)(int full);
18-
typedef void (*jl_gc_cb_task_scanner_t)(jl_task_t *task, int full);
17+
typedef void (*jl_gc_cb_root_scanner_t)(int full) JL_NOTSAFEPOINT;
18+
typedef void (*jl_gc_cb_task_scanner_t)(jl_task_t *task, int full) JL_NOTSAFEPOINT;
1919

2020
// Callbacks that are invoked before and after a collection.
21-
typedef void (*jl_gc_cb_pre_gc_t)(int full);
22-
typedef void (*jl_gc_cb_post_gc_t)(int full);
21+
typedef void (*jl_gc_cb_pre_gc_t)(int full) JL_NOTSAFEPOINT;
22+
typedef void (*jl_gc_cb_post_gc_t)(int full) JL_NOTSAFEPOINT;
2323

2424
// Callbacks to track external object allocations.
25-
typedef void (*jl_gc_cb_notify_external_alloc_t)(void *addr, size_t size);
26-
typedef void (*jl_gc_cb_notify_external_free_t)(void *addr);
25+
typedef void (*jl_gc_cb_notify_external_alloc_t)(void *addr, size_t size) JL_NOTSAFEPOINT;
26+
typedef void (*jl_gc_cb_notify_external_free_t)(void *addr) JL_NOTSAFEPOINT;
2727

2828
JL_DLLEXPORT void jl_gc_set_cb_root_scanner(jl_gc_cb_root_scanner_t cb, int enable);
2929
JL_DLLEXPORT void jl_gc_set_cb_task_scanner(jl_gc_cb_task_scanner_t cb, int enable);

0 commit comments

Comments
 (0)