Ruby
2.5.0dev(2017-10-22revision60238)
|
#include "internal.h"
#include "ruby/util.h"
#include "ruby/st.h"
#include "probes.h"
#include "id.h"
#include "debug_counter.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 | ) |
Definition at line 103 of file array.c.
Referenced by rb_ary_memsize(), rb_ary_resize(), and rb_ary_store().
#define ARY_EMBED_LEN | ( | a | ) |
#define ARY_EMBED_P | ( | ary | ) |
Definition at line 38 of file array.c.
Referenced by rb_ary_shared_with_p().
#define ARY_EMBED_PTR | ( | a | ) | (assert(ARY_EMBED_P(a)), RARRAY(a)->as.ary) |
#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) |
Definition at line 42 of file array.c.
Referenced by rb_ary_free().
#define ARY_HEAP_SIZE | ( | a | ) | (assert(!ARY_EMBED_P(a)), assert(ARY_OWNS_HEAP_P(a)), RARRAY(a)->as.heap.aux.capa * sizeof(VALUE)) |
Definition at line 49 of file array.c.
Referenced by rb_ary_free().
#define ARY_INCREASE_LEN | ( | ary, | |
n | |||
) |
Definition at line 93 of file array.c.
Referenced by rb_ary_delete_at().
#define ARY_INCREASE_PTR | ( | ary, | |
n | |||
) |
Definition at line 32 of file array.c.
Referenced by rb_ary_resize(), and rb_ary_store().
#define ARY_OWNS_HEAP_P | ( | a | ) | (!FL_TEST((a), ELTS_SHARED|RARRAY_EMBED_FLAG)) |
Definition at line 51 of file array.c.
Referenced by rb_ary_free(), and rb_ary_memsize().
#define ARY_SET | ( | a, | |
i, | |||
v | |||
) | RARRAY_ASET((assert(!ARY_SHARED_P(a)), (a)), (i), (v)) |
Definition at line 135 of file array.c.
Referenced by rb_ary_new_from_args().
#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 | |||
) |
Definition at line 79 of file array.c.
Referenced by rb_ary_new_from_args().
#define ARY_SET_PTR | ( | ary, | |
p | |||
) |
#define ARY_SET_SHARED | ( | ary, | |
value | |||
) |
#define ARY_SET_SHARED_NUM | ( | ary, | |
value | |||
) |
#define ARY_SHARED | ( | ary | ) | (assert(ARY_SHARED_P(ary)), RARRAY(ary)->as.heap.aux.shared) |
#define ARY_SHARED_NUM | ( | ary | ) | (assert(ARY_SHARED_ROOT_P(ary)), RARRAY(ary)->as.heap.aux.capa) |
#define ARY_SHARED_OCCUPIED | ( | ary | ) | (ARY_SHARED_NUM(ary) == 1) |
#define ARY_SHARED_P | ( | ary | ) |
Definition at line 35 of file array.c.
Referenced by rb_ary_shared_with_p(), and rb_ary_sort_bang().
#define ARY_SHARED_ROOT_P | ( | ary | ) | (FL_TEST((ary), RARRAY_SHARED_ROOT_FLAG)) |
#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) |
Referenced by asn1time_to_time(), create_win32ole_variable(), default_inspect(), DupConfigPtr(), generic_to_value(), if(), Init_console(), Init_objspace(), Init_Random(), Init_strscan(), ossl_obj2bio(), ossl_time_split(), rb_big_divmod(), rb_big_remainder(), rb_const_missing(), rb_define_alias(), rb_define_attr(), rb_define_class(), rb_define_class_under(), rb_define_const(), rb_define_method(), rb_define_module(), rb_define_module_under(), rb_define_private_method(), rb_define_protected_method(), rb_iseq_load_iseq(), rb_iv_get(), rb_iv_set(), rb_parser_append_print(), rb_parser_while_loop(), rb_threadptr_error_print(), and rb_undef_method().
#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 tmpbuf | ( | n, | |
size | |||
) | rb_str_tmp_new((n)*(size)) |
#define tmpbuf_discard | ( | s | ) | (rb_str_resize((s), 0L), RBASIC_SET_CLASS_RAW(s, rb_cString)) |
enum ary_take_pos_flags |
void Init_Array | ( | void | ) |
Definition at line 6206 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 1285 of file array.c.
References FIX2LONG, FIXNUM_P, len, NULL, NUM2LONG, Qfalse, Qnil, RARRAY_LEN, rb_ary_entry(), rb_ary_subseq(), rb_range_beg_len(), and rb_scan_args().
Definition at line 3792 of file array.c.
References NIL_P, Qnil, RARRAY_AREF, RARRAY_LEN, rb_check_array_type(), and rb_equal().
Definition at line 1332 of file array.c.
References NUM2LONG, and rb_ary_entry().
Referenced by rb_ary_dig().
Definition at line 936 of file array.c.
References RARRAY_LEN.
Definition at line 3501 of file array.c.
Referenced by rb_threadptr_pending_interrupt_clear().
Definition at line 4055 of file array.c.
References INT2FIX, len, NIL_P, Qnil, rb_check_array_type(), and rb_exec_recursive_paired().
Definition at line 3006 of file array.c.
References Qnil, RARRAY_AREF, RARRAY_LEN, rb_ary_store(), rb_block_given_p(), rb_equal(), and rb_yield().
Definition at line 3059 of file array.c.
References ARY_INCREASE_LEN, len, MEMMOVE, Qnil, RARRAY_AREF, RARRAY_LEN, RARRAY_PTR_USE, and rb_ary_modify().
Definition at line 3036 of file array.c.
References RARRAY_AREF, RARRAY_LEN, and rb_ary_store().
Definition at line 5799 of file array.c.
References argv, Qnil, rb_ary_at(), rb_check_arity, rb_obj_dig(), and UNLIMITED_ARGUMENTS.
Definition at line 1930 of file array.c.
References RARRAY_LEN, and rb_ary_new2.
Referenced by rb_ary_sort().
Definition at line 1821 of file array.c.
References RETURN_SIZED_ENUMERATOR.
Definition at line 1215 of file array.c.
References len, Qnil, RARRAY_CONST_PTR, and RARRAY_LEN.
Referenced by rb_ary_aref(), rb_ary_at(), and rb_error_frozen_object().
void rb_ary_free | ( | VALUE | ary | ) |
Definition at line 559 of file array.c.
References ARY_HEAP_PTR, ARY_HEAP_SIZE, ARY_OWNS_HEAP_P, RB_DEBUG_COUNTER_INC, RUBY_FUNC_EXPORTED, and ruby_sized_xfree().
Definition at line 409 of file array.c.
References rb_obj_freeze().
Definition at line 3975 of file array.c.
References Qfalse, Qtrue, RARRAY_AREF, RARRAY_LEN, and rb_equal().
Definition at line 1380 of file array.c.
References 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 571 of file array.c.
References ARY_CAPA, and ARY_OWNS_HEAP_P.
void rb_ary_modify | ( | VALUE | ary | ) |
Definition at line 319 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().
VALUE rb_ary_new | ( | void | ) |
Definition at line 499 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_f_untrace_var(), rb_insns_name_array(), rb_mod_ancestors(), rb_mod_included_modules(), rb_obj_instance_variables(), rb_scan_args(), and rb_thread_list().
VALUE rb_ary_new_capa | ( | long | capa | ) |
Definition at line 493 of file array.c.
Referenced by rb_hash_keys(), and rb_hash_values().
VALUE() rb_ary_new_from_args | ( | long | n, |
... | |||
) |
Definition at line 505 of file array.c.
References ARY_SET, ARY_SET_LEN, and rb_ary_new2.
Referenced by rb_iseq_pathobj_new().
Definition at line 538 of file array.c.
References rb_ary_tmp_new_from_values(), and rb_cArray.
Definition at line 924 of file array.c.
References RARRAY_LEN.
Referenced by ole_typedesc2val(), ossl_get_errors(), rb_f_untrace_var(), rb_gc_register_mark_object(), rb_get_kwargs(), rb_get_values_at(), rb_hash_fetch_values(), rb_hash_values_at(), rb_insns_name_array(), rb_iseq_add_mark_object(), rb_iseq_parameters(), rb_mod_ancestors(), rb_mod_included_modules(), rb_scan_args(), rb_thread_list(), and rb_threadptr_pending_interrupt_enque().
Definition at line 3825 of file array.c.
References Qnil, RARRAY_AREF, RARRAY_LEN, rb_equal(), RB_TYPE_P, and T_ARRAY.
expands or shrinks ary to len elements.
expanded region will be filled with Qnil.
ary | an array |
len | new size |
Definition at line 1648 of file array.c.
References ARY_CAPA, ARY_MAX_SIZE, RARRAY_LEN, rb_ary_modify(), rb_eIndexError, and rb_raise().
Referenced by rb_get_values_at().
Definition at line 1940 of file array.c.
References RARRAY_CONST_PTR, RARRAY_LEN, rb_ary_new4, and rb_output_fs.
Definition at line 2224 of file array.c.
References RARRAY_LEN, RARRAY_PTR_USE, and rb_ary_modify().
Definition at line 2288 of file array.c.
References RARRAY_LEN, RARRAY_PTR, and rb_ary_modify().
void rb_ary_set_len | ( | VALUE | ary, |
long | len | ||
) |
Definition at line 1625 of file array.c.
Referenced by rb_hash_keys(), and rb_hash_values().
Definition at line 437 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 1019 of file array.c.
References RARRAY_LEN, and top.
Definition at line 2549 of file array.c.
References ary_sort_data::ary, rb_ary_dup(), and rb_ary_sort_bang().
Definition at line 2465 of file array.c.
References ARY_SHARED_P, assert, RARRAY_LEN, and rb_ary_modify().
Referenced by rb_ary_sort().
Definition at line 815 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(), and rb_sym_to_proc().
Definition at line 1231 of file array.c.
References Qnil, RARRAY_LEN, and rb_obj_class().
Referenced by rb_apply(), and rb_ary_aref().
VALUE rb_ary_tmp_new | ( | long | capa | ) |
Definition at line 544 of file array.c.
Referenced by Init_vm_objects(), rb_gc_register_mark_object(), rb_get_kwargs(), rb_iseq_disasm(), and rb_sym_to_proc().
Definition at line 524 of file array.c.
Referenced by rb_ary_new_from_values().
Definition at line 1553 of file array.c.
References NIL_P, rb_ary_new3, and rb_check_array_type().
Definition at line 639 of file array.c.
References rb_ary_new3.
Referenced by rb_big_divrem_normal(), and rsock_ipaddr().
Definition at line 651 of file array.c.
References rb_check_convert_type_with_id(), and T_ARRAY.
Referenced by rb_Array(), rb_ary_assoc(), rb_ary_cmp(), rb_ary_to_ary(), and rb_yield_splat().
VALUE rb_get_values_at | ( | VALUE | obj, |
long | olen, | ||
int | argc, | ||
const VALUE * | argv, | ||
VALUE(*)(VALUE, long) | func | ||
) |
Definition at line 2789 of file array.c.
References argc, FIX2LONG, FIXNUM_P, len, NUM2LONG, RARRAY_LEN, rb_ary_new2, rb_ary_push(), rb_ary_resize(), and rb_range_beg_len().
void rb_mem_clear | ( | register VALUE * | mem, |
register long | size | ||
) |
VALUE rb_cArray |
Definition at line 26 of file array.c.
Referenced by Init_Array(), Init_pack(), and rb_ary_new_from_values().
VALUE rb_output_fs |
Definition at line 515 of file intern.h.
Referenced by rb_ary_resurrect(), and rb_io_print().