Skip to content

Commit 62b51d9

Browse files
committed
Use BUILDING_SHARED_GC instead of RB_AMALGAMATED_DEFAULT_GC
We can use the BUILDING_SHARED_GC flag to check if we're building gc_impl.h as a shared GC or building the default GC.
1 parent f43585b commit 62b51d9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

gc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val)
615615
#endif
616616

617617
static const char *obj_type_name(VALUE obj);
618-
#define RB_AMALGAMATED_DEFAULT_GC
619618
#include "gc/default/default.c"
620619

621620
#if USE_SHARED_GC && !defined(HAVE_DLOPEN)

gc/gc_impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
*/
1111
#include "ruby/ruby.h"
1212

13+
#ifdef BUILDING_SHARED_GC
14+
# define GC_IMPL_FN
15+
#else
1316
// `GC_IMPL_FN` is an implementation detail of `!USE_SHARED_GC` builds
1417
// to have the default GC in the same translation unit as gc.c for
1518
// the sake of optimizer visibility. It expands to nothing unless
@@ -18,10 +21,7 @@
1821
// For the default GC, do not copy-paste this when implementing
1922
// these functions. This takes advantage of internal linkage winning
2023
// when appearing first. See C99 6.2.2p4.
21-
#ifdef RB_AMALGAMATED_DEFAULT_GC
2224
# define GC_IMPL_FN static
23-
#else
24-
# define GC_IMPL_FN
2525
#endif
2626

2727
// Bootup

0 commit comments

Comments
 (0)