summaryrefslogtreecommitdiff
path: root/internal/array.h
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2022-06-09 15:59:08 +0100
committerPeter Zhu <peter@peterzhu.ca>2022-07-12 08:50:33 -0400
commit214ed4cbc6f33675230602dd09268b436da96f7d (patch)
tree0c1cd73729447e53136643b7975b39385ee7a711 /internal/array.h
parent0f8a0c5f371b0886e8e31e35a9095bc9843de27c (diff)
downloadruby-214ed4cbc6f33675230602dd09268b436da96f7d.tar.gz
[Feature #18901] Support size pool movement for Arrays
This commit enables Arrays to move between size pools during compaction. This can occur if the array is mutated such that it would fit in a different size pool when embedded. The move is carried out in two stages: 1. The RVALUE is moved to a destination heap during object movement phase of compaction 2. The array data is re-embedded and the original buffer free'd if required. This happens during the update references step
Diffstat (limited to 'internal/array.h')
-rw-r--r--internal/array.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/array.h b/internal/array.h
index 60f66f31bf..690196a1e2 100644
--- a/internal/array.h
+++ b/internal/array.h
@@ -30,6 +30,9 @@ size_t rb_ary_memsize(VALUE);
VALUE rb_to_array_type(VALUE obj);
VALUE rb_to_array(VALUE obj);
void rb_ary_cancel_sharing(VALUE ary);
+size_t rb_ary_size_as_embedded(VALUE ary);
+void rb_ary_make_embedded(VALUE ary);
+bool rb_ary_embeddable_p(VALUE ary);
static inline VALUE rb_ary_entry_internal(VALUE ary, long offset);
static inline bool ARY_PTR_USING_P(VALUE ary);