summaryrefslogtreecommitdiff
path: root/internal/gc.h
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-12-15 13:54:07 -0500
committerPeter Zhu <peter@peterzhu.ca>2022-12-15 16:33:46 -0500
commitc505448cdbd4cd1a52ed7108095f6738d29b3419 (patch)
treead8015b495af23c8991f3b115f95799b513ccde9 /internal/gc.h
parentd5eafaed812bc683d5069154c5c9391ba98ea151 (diff)
downloadruby-c505448cdbd4cd1a52ed7108095f6738d29b3419.tar.gz
Move definition of SIZE_POOL_COUNT back to gc.h
SIZE_POOL_COUNT is a GC macro, it should belong in gc.h and not shape.h. SIZE_POOL_COUNT doesn't depend on shape.h so we can have shape.h depend on gc.h. Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
Diffstat (limited to 'internal/gc.h')
-rw-r--r--internal/gc.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/gc.h b/internal/gc.h
index d43eb29578..e54a5dce9d 100644
--- a/internal/gc.h
+++ b/internal/gc.h
@@ -67,7 +67,13 @@ struct rb_objspace; /* in vm_core.h */
rb_obj_write((VALUE)(a), UNALIGNED_MEMBER_ACCESS((VALUE *)(slot)), \
(VALUE)(b), __FILE__, __LINE__)
-#include "shape.h"
+// We use SIZE_POOL_COUNT number of shape IDs for transitions out of different size pools
+// The next available shapd ID will be the SPECIAL_CONST_SHAPE_ID
+#if USE_RVARGC && (SIZEOF_UINT64_T == SIZEOF_VALUE)
+# define SIZE_POOL_COUNT 5
+#else
+# define SIZE_POOL_COUNT 1
+#endif
#define RCLASS_EXT_EMBEDDED (SIZE_POOL_COUNT > 1)