From cea9c30fa549885e36471f1782359df2bdcf895a Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 19 Apr 2023 16:16:27 -0400 Subject: Move ar_hint to ar_table_struct This allows Hashes with ST tables to fit int he 80 byte size pool. --- internal/hash.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'internal') diff --git a/internal/hash.h b/internal/hash.h index c9a8b49c20..248a53429d 100644 --- a/internal/hash.h +++ b/internal/hash.h @@ -46,6 +46,10 @@ typedef struct ar_table_pair_struct { } ar_table_pair; typedef struct ar_table_struct { + union { + ar_hint_t ary[RHASH_AR_TABLE_MAX_SIZE]; + VALUE word; + } ar_hint; /* 64bit CPU: 8B * 2 * 8 = 128B */ ar_table_pair pairs[RHASH_AR_TABLE_MAX_SIZE]; } ar_table; @@ -53,20 +57,10 @@ typedef struct ar_table_struct { struct RHash { struct RBasic basic; const VALUE ifnone; - union { - ar_hint_t ary[RHASH_AR_TABLE_MAX_SIZE]; - VALUE word; - } ar_hint; }; #define RHASH(obj) ((struct RHash *)(obj)) -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#define RHASH_SLOT_SIZE (sizeof(struct RHash) + MAX(sizeof(ar_table), sizeof(st_table))) - #ifdef RHASH_IFNONE # undef RHASH_IFNONE #endif -- cgit v1.2.1