Enable 5 size pools on 32 bit systems
This commit will allow 32 bit systems to take advantage of VWA.
This commit is contained in:
parent
7297374c5e
commit
b4571097df
Notes:
git
2023-04-11 15:25:36 +00:00
10
gc.c
10
gc.c
@ -2824,9 +2824,6 @@ newobj_slowpath(VALUE klass, VALUE flags, rb_objspace_t *objspace, rb_ractor_t *
|
|||||||
}
|
}
|
||||||
|
|
||||||
obj = newobj_alloc(objspace, cr, size_pool_idx, true);
|
obj = newobj_alloc(objspace, cr, size_pool_idx, true);
|
||||||
#if SHAPE_IN_BASIC_FLAGS
|
|
||||||
flags |= (VALUE)(size_pool_idx) << SHAPE_FLAG_SHIFT;
|
|
||||||
#endif
|
|
||||||
newobj_init(klass, flags, wb_protected, objspace, obj);
|
newobj_init(klass, flags, wb_protected, objspace, obj);
|
||||||
|
|
||||||
gc_event_hook_prep(objspace, RUBY_INTERNAL_EVENT_NEWOBJ, obj, newobj_zero_slot(obj));
|
gc_event_hook_prep(objspace, RUBY_INTERNAL_EVENT_NEWOBJ, obj, newobj_zero_slot(obj));
|
||||||
@ -2873,14 +2870,15 @@ newobj_of0(VALUE klass, VALUE flags, int wb_protected, rb_ractor_t *cr, size_t a
|
|||||||
|
|
||||||
size_t size_pool_idx = size_pool_idx_for_size(alloc_size);
|
size_t size_pool_idx = size_pool_idx_for_size(alloc_size);
|
||||||
|
|
||||||
|
if (SHAPE_IN_BASIC_FLAGS || (flags & RUBY_T_MASK) == T_OBJECT) {
|
||||||
|
flags |= (VALUE)size_pool_idx << SHAPE_FLAG_SHIFT;
|
||||||
|
}
|
||||||
|
|
||||||
if (!UNLIKELY(during_gc ||
|
if (!UNLIKELY(during_gc ||
|
||||||
ruby_gc_stressful ||
|
ruby_gc_stressful ||
|
||||||
gc_event_hook_available_p(objspace)) &&
|
gc_event_hook_available_p(objspace)) &&
|
||||||
wb_protected) {
|
wb_protected) {
|
||||||
obj = newobj_alloc(objspace, cr, size_pool_idx, false);
|
obj = newobj_alloc(objspace, cr, size_pool_idx, false);
|
||||||
#if SHAPE_IN_BASIC_FLAGS
|
|
||||||
flags |= (VALUE)size_pool_idx << SHAPE_FLAG_SHIFT;
|
|
||||||
#endif
|
|
||||||
newobj_init(klass, flags, wb_protected, objspace, obj);
|
newobj_init(klass, flags, wb_protected, objspace, obj);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -186,14 +186,11 @@ struct rb_objspace; /* in vm_core.h */
|
|||||||
// We use SIZE_POOL_COUNT number of shape IDs for transitions out of different size pools
|
// 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
|
// The next available shape ID will be the SPECIAL_CONST_SHAPE_ID
|
||||||
#ifndef SIZE_POOL_COUNT
|
#ifndef SIZE_POOL_COUNT
|
||||||
# if (SIZEOF_UINT64_T == SIZEOF_VALUE)
|
# define SIZE_POOL_COUNT 5
|
||||||
# define SIZE_POOL_COUNT 5
|
|
||||||
# else
|
|
||||||
# define SIZE_POOL_COUNT 1
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define RCLASS_EXT_EMBEDDED (SIZE_POOL_COUNT > 1)
|
// TODO: Make rb_classext_t small enough to fit in 80 bytes on 32 bit
|
||||||
|
#define RCLASS_EXT_EMBEDDED (SIZEOF_UINT64_T == SIZEOF_VALUE)
|
||||||
|
|
||||||
typedef struct ractor_newobj_size_pool_cache {
|
typedef struct ractor_newobj_size_pool_cache {
|
||||||
struct RVALUE *freelist;
|
struct RVALUE *freelist;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user