diff options
author | Peter Zhu <[email protected]> | 2023-04-14 16:28:14 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-04-16 11:06:31 -0400 |
commit | a0d1069e03fd52355e26d8cc3cbbed34632876e6 (patch) | |
tree | 3abec6a571c2a53631fc1d385e2bf7fe429251af /internal/class.h | |
parent | 24b137336b71f77bf9ae9c532c0a5520709f73e8 (diff) |
Make classes embedded on 32 bit
Classes are now exactly 80 bytes when embedded, which perfectly fits the
3rd size pool on 32 bit systems.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7719
Diffstat (limited to 'internal/class.h')
-rw-r--r-- | internal/class.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/internal/class.h b/internal/class.h index 3e5108a3bd..b33c807e97 100644 --- a/internal/class.h +++ b/internal/class.h @@ -76,21 +76,12 @@ struct RClass { struct RBasic basic; VALUE super; struct rb_id_table *m_tbl; -#if !RCLASS_EXT_EMBEDDED - struct rb_classext_struct *ptr; -#endif }; -#if RCLASS_EXT_EMBEDDED // Assert that classes can be embedded in size_pools[2] (which has 160B slot size) STATIC_ASSERT(sizeof_rb_classext_t, sizeof(struct RClass) + sizeof(rb_classext_t) <= 4 * RVALUE_SIZE); -#endif -#if RCLASS_EXT_EMBEDDED -# define RCLASS_EXT(c) ((rb_classext_t *)((char *)(c) + sizeof(struct RClass))) -#else -# define RCLASS_EXT(c) (RCLASS(c)->ptr) -#endif +#define RCLASS_EXT(c) ((rb_classext_t *)((char *)(c) + sizeof(struct RClass))) #define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl) #define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl) #define RCLASS_IVPTR(c) (RCLASS_EXT(c)->iv_ptr) |