From 5f21e15f028cf92cdbcfc659b76fb9efe78fbd1c Mon Sep 17 00:00:00 2001 From: Jake Hughes Date: Thu, 8 Aug 2024 13:11:17 +0100 Subject: [PATCH] Conditionally compile buffered finalization --- include/gc/gc_disclaim.h | 3 +++ misc.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/include/gc/gc_disclaim.h b/include/gc/gc_disclaim.h index f0ea6b7e0..186f18574 100644 --- a/include/gc/gc_disclaim.h +++ b/include/gc/gc_disclaim.h @@ -69,6 +69,7 @@ GC_API GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1) void * GC_CALL const struct GC_finalizer_closure * /* fc */) GC_ATTR_NONNULL(2); +#ifdef BUFFERED_FINALIZATION /* This API is defined only if the library has been suitably compiled */ /* (i.e. with ENABLE_DISCLAIM defined). */ @@ -105,6 +106,8 @@ GC_API void GC_CALL GC_finalize_objects(void); GC_API size_t GC_finalized_total(void); +#endif + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/misc.c b/misc.c index 48ecf8893..4b78789eb 100644 --- a/misc.c +++ b/misc.c @@ -37,6 +37,10 @@ # include #endif +#ifdef BUFFERED_FINALIZATION +# include "gc/gc_disclaim.h" +#endif + #ifdef THREADS # ifdef PCR # include "il/PCR_IL.h"