Ruby
3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
|
Ruby's array. More...
#include <rarray.h>
Data Fields | |
struct RBasic | basic |
Basic part, including flags and class. More... | |
union { | |
struct { | |
long len | |
Number of elements of the array. More... | |
union { | |
long capa | |
Capacity of *ptr . More... | |
const VALUE shared_root | |
Parent of the array. More... | |
} aux | |
Auxiliary info. More... | |
const VALUE * ptr | |
Pointer to the C array that holds the elements of the array. More... | |
} heap | |
Arrays that use separated memory region for elements use this pattern. More... | |
const VALUE ary [1] | |
Embedded elements. More... | |
} | as |
Array's specific fields. More... | |
const VALUE RArray::ary[1] |
Embedded elements.
When an array is short enough, it uses this area to store its elements. In this case the length is encoded into the flags.
Definition at line 188 of file rarray.h.
Referenced by rb_ary_aref(), rb_ary_cat(), rb_ary_dup(), rb_ary_each(), rb_ary_entry(), rb_ary_free(), rb_ary_freeze(), rb_ary_hidden_new(), rb_ary_join(), rb_ary_modify(), rb_ary_new_from_args(), rb_ary_pop(), rb_ary_push(), rb_ary_resize(), rb_ary_resurrect(), rb_ary_reverse(), rb_ary_rotate(), rb_ary_shift(), rb_ary_store(), rb_ary_subseq(), rb_ary_to_s(), and rb_ary_unshift().
union { ... } RArray::as |
Array's specific fields.
union { ... } RArray::aux |
Auxiliary info.
struct RBasic RArray::basic |
long RArray::capa |
struct { ... } RArray::heap |
Arrays that use separated memory region for elements use this pattern.
const VALUE* RArray::ptr |
const VALUE RArray::shared_root |