From a2ff9423a1ecc4f2831a69f82a60f00c4a3f81a9 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 27 Mar 2023 09:40:24 -0400 Subject: [PATCH] Allow user defined SIZE_POOL_COUNT We shouldn't overwrite the value of SIZE_POOL_COUNT if the user has specified one. --- internal/gc.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/gc.h b/internal/gc.h index 0abdb22ffd..2b67ca40dc 100644 --- a/internal/gc.h +++ b/internal/gc.h @@ -189,10 +189,12 @@ struct rb_objspace; /* in vm_core.h */ // We use SIZE_POOL_COUNT number of shape IDs for transitions out of different size pools // The next available shape 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 +#ifndef SIZE_POOL_COUNT +# if USE_RVARGC && (SIZEOF_UINT64_T == SIZEOF_VALUE) +# define SIZE_POOL_COUNT 5 +# else +# define SIZE_POOL_COUNT 1 +# endif #endif #define RCLASS_EXT_EMBEDDED (SIZE_POOL_COUNT > 1)