Skip to content

Commit

Permalink
NFC: move memory pressure callback declaration to julia_gcext.h (Juli…
Browse files Browse the repository at this point in the history
…aLang#52962)

It should probably be in `julia_gcext.h` together with the other
callbacks for consistency.
  • Loading branch information
d-netto committed Jan 19, 2024
1 parent eb26d63 commit 48ef5e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ static jl_gc_callback_list_t *gc_cblist_post_gc;
static jl_gc_callback_list_t *gc_cblist_notify_external_alloc;
static jl_gc_callback_list_t *gc_cblist_notify_external_free;
static jl_gc_callback_list_t *gc_cblist_notify_gc_pressure;
typedef void (*jl_gc_cb_notify_gc_pressure_t)(void);

#define gc_invoke_callbacks(ty, list, args) \
do { \
Expand Down
4 changes: 4 additions & 0 deletions src/julia_gcext.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ JL_DLLEXPORT void jl_gc_set_cb_notify_external_alloc(jl_gc_cb_notify_external_al
JL_DLLEXPORT void jl_gc_set_cb_notify_external_free(jl_gc_cb_notify_external_free_t cb,
int enable);

// Memory pressure callback
typedef void (*jl_gc_cb_notify_gc_pressure_t)(void) JL_NOTSAFEPOINT;
JL_DLLEXPORT void jl_gc_set_cb_notify_gc_pressure(jl_gc_cb_notify_gc_pressure_t cb, int enable);

// Types for custom mark and sweep functions.
typedef uintptr_t (*jl_markfunc_t)(jl_ptls_t, jl_value_t *obj);
typedef void (*jl_sweepfunc_t)(jl_value_t *obj);
Expand Down

0 comments on commit 48ef5e9

Please sign in to comment.