Ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5ad0e4688e963d9de019557c78feed9)
|
#include "ruby/encoding.h"
#include "ruby/util.h"
#include "ruby/st.h"
#include "probes.h"
#include "id.h"
#include "debug_counter.h"
#include "transient_heap.h"
#include "internal.h"
#include "ruby_assert.h"
Go to the source code of this file.
Data Structures | |
struct | ary_sort_data |
struct | select_bang_arg |
Enumerations | |
enum | ary_take_pos_flags { ARY_TAKE_FIRST = 0 , ARY_TAKE_LAST = 1 } |
Variables | |
VALUE | rb_cArray |
VALUE | rb_output_fs |
#define ARY_CAPA | ( | ary | ) |
#define ARY_EMBED_LEN | ( | a | ) |
#define ARY_EMBED_P | ( | ary | ) |
#define ARY_EMBED_PTR | ( | a | ) | (assert(ARY_EMBED_P(a)), RARRAY(a)->as.ary) |
#define ARY_HEAP_CAPA | ( | a | ) |
#define ARY_HEAP_LEN | ( | a | ) | (assert(!ARY_EMBED_P(a)), RARRAY(a)->as.heap.len) |
#define ARY_HEAP_PTR | ( | a | ) | (assert(!ARY_EMBED_P(a)), RARRAY(a)->as.heap.ptr) |
#define ARY_HEAP_SIZE | ( | a | ) | (assert(!ARY_EMBED_P(a)), assert(ARY_OWNS_HEAP_P(a)), ARY_CAPA(a) * sizeof(VALUE)) |
#define ARY_INCREASE_LEN | ( | ary, | |
n | |||
) |
#define ARY_INCREASE_PTR | ( | ary, | |
n | |||
) |
#define ARY_OWNS_HEAP_P | ( | a | ) |
#define ARY_SET_CAPA | ( | ary, | |
n | |||
) |
#define ARY_SET_EMBED_LEN | ( | ary, | |
n | |||
) |
#define ARY_SET_HEAP_LEN | ( | ary, | |
n | |||
) |
#define ARY_SET_LEN | ( | ary, | |
n | |||
) |
#define ARY_SET_PTR | ( | ary, | |
p | |||
) |
#define ARY_SET_SHARED | ( | ary, | |
value | |||
) |
#define ARY_SET_SHARED_ROOT_REFCNT | ( | ary, | |
value | |||
) |
#define ARY_SHARED_P | ( | ary | ) |
#define ARY_SHARED_ROOT | ( | ary | ) | (assert(ARY_SHARED_P(ary)), RARRAY(ary)->as.heap.aux.shared_root) |
#define ARY_SHARED_ROOT_OCCUPIED | ( | ary | ) | (ARY_SHARED_ROOT_REFCNT(ary) == 1) |
#define ARY_SHARED_ROOT_P | ( | ary | ) |
#define ARY_SHARED_ROOT_REFCNT | ( | ary | ) | (assert(ARY_SHARED_ROOT_P(ary)), RARRAY(ary)->as.heap.aux.capa) |
#define FL_SET_EMBED | ( | a | ) |
#define FL_SET_SHARED | ( | ary | ) |
#define FL_SET_SHARED_ROOT | ( | ary | ) |
#define FL_UNSET_EMBED | ( | ary | ) | FL_UNSET((ary), RARRAY_EMBED_FLAG|RARRAY_EMBED_LEN_MASK) |
#define FL_UNSET_SHARED | ( | ary | ) | FL_UNSET((ary), ELTS_SHARED) |
#define RAND_UPTO | ( | max | ) | (long)rb_random_ulong_limited((randgen), (max)-1) |
#define rb_intern | ( | str | ) | rb_intern_const(str) |
#define RUBY_UNTYPED_DATA_WARNING 0 |
#define tmpary | ( | n | ) | rb_ary_tmp_new(n) |
#define tmpary_discard | ( | a | ) | (ary_discard(a), RBASIC_SET_CLASS_RAW(a, rb_cArray)) |
#define to_ary rb_to_array_type |
enum ary_take_pos_flags |
Definition at line 6927 of file array.c.
References rb_cArray, rb_cObject, rb_define_alloc_func(), rb_define_class(), rb_include_module(), and rb_mEnumerable.
Definition at line 1574 of file array.c.
References argc, and rb_check_arity.
MJIT_FUNC_EXPORTED VALUE rb_ary_aref1 | ( | VALUE | ary, |
VALUE | arg | ||
) |
Definition at line 1595 of file array.c.
References arg, FIX2LONG, FIXNUM_P, len, NUM2LONG, Qfalse, Qnil, RARRAY_LEN, rb_ary_entry(), rb_ary_subseq(), and rb_range_beg_len().
Definition at line 4156 of file array.c.
References select_bang_arg::ary, i, key, NIL_P, Qnil, RARRAY_AREF, RARRAY_LEN, rb_check_array_type(), rb_equal(), and v.
Definition at line 1629 of file array.c.
References NUM2LONG, and rb_ary_entry().
MJIT_FUNC_EXPORTED VALUE rb_ary_behead | ( | VALUE | ary, |
long | n | ||
) |
Definition at line 1208 of file array.c.
References RARRAY_LEN.
Definition at line 3862 of file array.c.
Referenced by rb_threadptr_pending_interrupt_clear().
Definition at line 4420 of file array.c.
References INT2FIX, len, NIL_P, Qnil, rb_check_array_type(), rb_exec_recursive_paired(), and v.
Definition at line 3365 of file array.c.
References select_bang_arg::ary, Qnil, RARRAY_AREF, RARRAY_LEN, rb_ary_store(), rb_block_given_p(), rb_equal(), rb_yield(), and v.
Definition at line 3419 of file array.c.
References select_bang_arg::ary, ARY_INCREASE_LEN, ary_verify, len, MEMMOVE, ptr, Qnil, RARRAY_AREF, RARRAY_LEN, RARRAY_PTR_USE_TRANSIENT, and rb_ary_modify().
Definition at line 3396 of file array.c.
References select_bang_arg::ary, RARRAY_AREF, RARRAY_LEN, and rb_ary_store().
Definition at line 408 of file array.c.
References assert, and RARRAY_TRANSIENT_P.
Definition at line 2238 of file array.c.
References dup(), len, RARRAY_LEN, and rb_ary_new2.
Referenced by rb_ary_sort().
Definition at line 2129 of file array.c.
References ary_verify, i, and RETURN_SIZED_ENUMERATOR.
Definition at line 1512 of file array.c.
Referenced by rb_ary_aref1(), and rb_ary_at().
Definition at line 786 of file array.c.
References ARY_HEAP_CAPA, ARY_OWNS_HEAP_P, ARY_SHARED_ROOT_P, RARRAY_LEN, RARRAY_TRANSIENT_P, RB_DEBUG_COUNTER_INC, and USE_DEBUG_COUNTER.
Definition at line 648 of file array.c.
References rb_obj_freeze().
Definition at line 4340 of file array.c.
References select_bang_arg::ary, i, Qfalse, Qtrue, RARRAY_AREF, RARRAY_LEN, and rb_equal().
Definition at line 1677 of file array.c.
References argc, len, Qnil, RARRAY_AREF, and RARRAY_LEN.
Referenced by rb_gc_register_mark_object().
RUBY_FUNC_EXPORTED size_t rb_ary_memsize | ( | VALUE | ary | ) |
Definition at line 816 of file array.c.
References ARY_CAPA, ARY_OWNS_HEAP_P, and VALUE.
Definition at line 548 of file array.c.
Referenced by rb_ary_delete_at(), rb_ary_resize(), rb_ary_reverse(), rb_ary_rotate(), rb_ary_sort_bang(), and rb_ary_store().
Definition at line 723 of file array.c.
References RARRAY_EMBED_LEN_MAX, and rb_ary_new2.
Referenced by ole_methods_from_typeinfo(), ole_variant2val(), ossl_get_errors(), rb_call_end_proc(), rb_f_global_variables(), rb_mod_ancestors(), rb_mod_included_modules(), rb_obj_instance_variables(), and rb_thread_list().
Definition at line 717 of file array.c.
Referenced by rb_insns_name_array().
Definition at line 762 of file array.c.
References n, rb_ary_tmp_new_from_values(), and rb_cArray.
Definition at line 4000 of file array.c.
References len, RARRAY_LEN, rb_ary_new2, and to_ary.
Definition at line 235 of file array.c.
References FL_UNSET_RAW, and RARRAY_PTR_IN_USE_FLAG.
Definition at line 226 of file array.c.
References FL_SET_RAW, RARRAY_CONST_PTR_TRANSIENT, and RARRAY_PTR_IN_USE_FLAG.
Definition at line 1195 of file array.c.
References ary_verify, and RARRAY_LEN.
Referenced by ole_typedesc2val(), ossl_get_errors(), rb_gc_register_mark_object(), rb_get_kwargs(), rb_insns_name_array(), rb_iseq_parameters(), rb_mod_ancestors(), rb_mod_included_modules(), rb_thread_list(), rb_threadptr_pending_interrupt_enque(), and rb_unnamed_parameters().
Definition at line 4189 of file array.c.
References select_bang_arg::ary, i, Qnil, RARRAY_AREF, RARRAY_LEN, rb_equal(), RB_TYPE_P, T_ARRAY, and v.
expands or shrinks ary to len elements.
expanded region will be filled with Qnil.
ary | an array |
len | new size |
Definition at line 1955 of file array.c.
References ARY_CAPA, ARY_MAX_SIZE, len, RARRAY_LEN, rb_ary_modify(), rb_eIndexError, and rb_raise().
Definition at line 2544 of file array.c.
References len, RARRAY_LEN, RARRAY_PTR_USE_TRANSIENT, and rb_ary_modify().
Definition at line 2617 of file array.c.
References cnt, len, RARRAY_LEN, and rb_ary_modify().
Definition at line 661 of file array.c.
References ARY_EMBED_P, ARY_SHARED_P, Qfalse, Qtrue, and RARRAY.
Referenced by rb_get_expanded_load_path().
Definition at line 1294 of file array.c.
References len, RARRAY_LEN, and top.
Definition at line 2866 of file array.c.
References ary_sort_data::ary, rb_ary_dup(), and rb_ary_sort_bang().
Definition at line 2777 of file array.c.
References ary_sort_data::ary, ARY_SHARED_P, assert, RARRAY_LEN, and rb_ary_modify().
Referenced by rb_ary_sort().
Definition at line 1079 of file array.c.
References ARY_CAPA, ARY_MAX_SIZE, len, RARRAY_LEN, rb_ary_modify(), rb_eIndexError, and rb_raise().
Referenced by ossl_generate_cb_2(), rb_ary_delete(), rb_ary_delete_same(), rb_sym_to_proc(), and rb_unnamed_parameters().
Definition at line 1518 of file array.c.
References klass, len, Qnil, RARRAY_LEN, and rb_obj_class().
Referenced by rb_ary_aref1().
Definition at line 768 of file array.c.
Referenced by Init_vm_objects(), rb_default_coverage(), rb_gc_register_mark_object(), rb_get_kwargs(), and rb_sym_to_proc().
Definition at line 776 of file array.c.
Referenced by rb_default_coverage().
Definition at line 748 of file array.c.
Referenced by rb_ary_new_from_values().
Definition at line 1853 of file array.c.
References NIL_P, obj, rb_ary_new3, and rb_check_array_type().
Definition at line 896 of file array.c.
References rb_ary_new3.
Referenced by rb_big_divrem_normal().
Definition at line 909 of file array.c.
References idTo_ary, rb_check_convert_type_with_id(), and T_ARRAY.
Referenced by rb_Array(), rb_ary_assoc(), rb_ary_cmp(), rb_ary_to_ary(), rb_yield_splat(), and rb_yield_splat_kw().
MJIT_FUNC_EXPORTED VALUE rb_check_to_array | ( | VALUE | ary | ) |
Definition at line 915 of file array.c.
References idTo_a, rb_check_convert_type_with_id(), and T_ARRAY.
Referenced by rb_Array().
Definition at line 902 of file array.c.
References idTo_ary, rb_convert_type_with_id(), and T_ARRAY.
VALUE rb_cArray |
Definition at line 27 of file array.c.
Referenced by Init_Array(), and rb_ary_new_from_values().
|
extern |
Definition at line 584 of file intern.h.
Referenced by rb_io_print().