summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorMatt Valentine-House <[email protected]>2024-10-03 13:53:49 +0100
committerMatt Valentine-House <[email protected]>2024-10-03 21:20:09 +0100
commit8e7df4b7c674cf408fa570b9593811167bbff04a (patch)
treefe143affd6601f6fc1a94d5a25084696ea8f660e /object.c
parentb58a3645229b6c82c1f199fd948ec1fa97c0cc10 (diff)
Rename size_pool -> heap
Now that we've inlined the eden_heap into the size_pool, we should rename the size_pool to heap. So that Ruby contains multiple heaps, with different sized objects. The term heap as a collection of memory pages is more in memory management nomenclature, whereas size_pool was a name chosen out of necessity during the development of the Variable Width Allocation features of Ruby. The concept of size pools was introduced in order to facilitate different sized objects (other than the default 40 bytes). They wrapped the eden heap and the tomb heap, and some related state, and provided a reasonably simple way of duplicating all related concerns, to provide multiple pools that all shared the same structure but held different objects. Since then various changes have happend in Ruby's memory layout: * The concept of tomb heaps has been replaced by a global free pages list, with each page having it's slot size reconfigured at the point when it is resurrected * the eden heap has been inlined into the size pool itself, so that now the size pool directly controls the free_pages list, the sweeping page, the compaction cursor and the other state that was previously being managed by the eden heap. Now that there is no need for a heap wrapper, we should refer to the collection of pages containing Ruby objects as a heap again rather than a size pool
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11771
Diffstat (limited to 'object.c')
-rw-r--r--object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/object.c b/object.c
index ae6ec6ea54..1bd476b022 100644
--- a/object.c
+++ b/object.c
@@ -135,7 +135,7 @@ rb_class_allocate_instance(VALUE klass)
RUBY_ASSERT(rb_shape_get_shape(obj)->type == SHAPE_ROOT);
// Set the shape to the specific T_OBJECT shape.
- ROBJECT_SET_SHAPE_ID(obj, (shape_id_t)(rb_gc_size_pool_id_for_size(size) + FIRST_T_OBJECT_SHAPE_ID));
+ ROBJECT_SET_SHAPE_ID(obj, (shape_id_t)(rb_gc_heap_id_for_size(size) + FIRST_T_OBJECT_SHAPE_ID));
#if RUBY_DEBUG
RUBY_ASSERT(!rb_shape_obj_too_complex(obj));
@@ -358,7 +358,7 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj)
rb_shape_t * initial_shape = rb_shape_get_shape(dest);
- if (initial_shape->size_pool_index != src_shape->size_pool_index) {
+ if (initial_shape->heap_index != src_shape->heap_index) {
RUBY_ASSERT(initial_shape->type == SHAPE_T_OBJECT);
shape_to_set_on_dest = rb_shape_rebuild_shape(initial_shape, src_shape);