Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "internal.h"
#include "ruby/st.h"
#include "ruby/re.h"
#include "ruby/io.h"
#include "ruby/thread.h"
#include "ruby/util.h"
#include "ruby/debug.h"
#include "eval_intern.h"
#include "vm_core.h"
#include "gc.h"
#include "constant.h"
#include "ruby_atomic.h"
#include "probes.h"
#include "id_table.h"
#include <stdio.h>
#include <stdarg.h>
#include <setjmp.h>
#include <sys/types.h>
#include "ruby_assert.h"
#include "regint.h"
Go to the source code of this file.
Data Structures | |
struct | ruby_gc_params_t |
struct | gc_profile_record |
struct | RVALUE |
struct | heap_page_header |
struct | heap_page_body |
struct | gc_list |
struct | stack_chunk |
struct | mark_stack |
struct | rb_heap_struct |
struct | rb_objspace |
struct | rb_objspace::mark_func_data_struct |
struct | heap_page |
struct | RZombie |
struct | each_obj_args |
struct | os_each_struct |
struct | force_finalize_list |
struct | verify_internal_consistency_struct |
struct | objspace_and_reason |
struct | root_objects_data |
struct | weakmap |
struct | wmap_iter_arg |
Macros | |
#define | rb_data_object_alloc rb_data_object_alloc |
#define | rb_data_typed_object_alloc rb_data_typed_object_alloc |
#define | ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS |
#define | rb_setjmp(env) RUBY_SETJMP(env) |
#define | rb_jmp_buf rb_jmpbuf_t |
#define | GC_HEAP_INIT_SLOTS 10000 |
#define | GC_HEAP_FREE_SLOTS 4096 |
#define | GC_HEAP_GROWTH_FACTOR 1.8 |
#define | GC_HEAP_GROWTH_MAX_SLOTS 0 /* 0 is disable */ |
#define | GC_HEAP_OLDOBJECT_LIMIT_FACTOR 2.0 |
#define | GC_HEAP_FREE_SLOTS_MIN_RATIO 0.20 |
#define | GC_HEAP_FREE_SLOTS_GOAL_RATIO 0.40 |
#define | GC_HEAP_FREE_SLOTS_MAX_RATIO 0.65 |
#define | GC_MALLOC_LIMIT_MIN (16 * 1024 * 1024 /* 16MB */) |
#define | GC_MALLOC_LIMIT_MAX (32 * 1024 * 1024 /* 32MB */) |
#define | GC_MALLOC_LIMIT_GROWTH_FACTOR 1.4 |
#define | GC_OLDMALLOC_LIMIT_MIN (16 * 1024 * 1024 /* 16MB */) |
#define | GC_OLDMALLOC_LIMIT_GROWTH_FACTOR 1.2 |
#define | GC_OLDMALLOC_LIMIT_MAX (128 * 1024 * 1024 /* 128MB */) |
#define | PRINT_MEASURE_LINE 0 |
#define | PRINT_ENTER_EXIT_TICK 0 |
#define | PRINT_ROOT_TICKS 0 |
#define | USE_TICK_T (PRINT_ENTER_EXIT_TICK || PRINT_MEASURE_LINE || PRINT_ROOT_TICKS) |
#define | TICK_TYPE 1 |
#define | GC_DEBUG 0 |
#define | RGENGC_DEBUG 0 |
#define | RGENGC_CHECK_MODE 0 |
#define | RGENGC_OLD_NEWOBJ_CHECK 0 |
#define | RGENGC_PROFILE 0 |
#define | RGENGC_ESTIMATE_OLDMALLOC 1 |
#define | RGENGC_FORCE_MAJOR_GC 0 |
#define | GC_PROFILE_MORE_DETAIL 0 |
#define | GC_PROFILE_DETAIL_MEMORY 0 |
#define | GC_ENABLE_INCREMENTAL_MARK USE_RINCGC |
#define | GC_ENABLE_LAZY_SWEEP 1 |
#define | CALC_EXACT_MALLOC_SIZE 0 |
#define | MALLOC_ALLOCATED_SIZE 0 |
#define | MALLOC_ALLOCATED_SIZE_CHECK 0 |
#define | GC_DEBUG_STRESS_TO_CLASS 0 |
#define | RGENGC_OBJ_INFO (RGENGC_DEBUG | RGENGC_CHECK_MODE) |
#define | STACK_CHUNK_SIZE 500 |
#define | HEAP_PAGE_ALIGN_LOG 14 |
#define | CEILDIV(i, mod) (((i) + (mod) - 1)/(mod)) |
#define | GET_PAGE_BODY(x) ((struct heap_page_body *)((bits_t)(x) & ~(HEAP_PAGE_ALIGN_MASK))) |
#define | GET_PAGE_HEADER(x) (&GET_PAGE_BODY(x)->header) |
#define | GET_HEAP_PAGE(x) (GET_PAGE_HEADER(x)->page) |
#define | NUM_IN_PAGE(p) (((bits_t)(p) & HEAP_PAGE_ALIGN_MASK)/sizeof(RVALUE)) |
#define | BITMAP_INDEX(p) (NUM_IN_PAGE(p) / BITS_BITLENGTH ) |
#define | BITMAP_OFFSET(p) (NUM_IN_PAGE(p) & (BITS_BITLENGTH-1)) |
#define | BITMAP_BIT(p) ((bits_t)1 << BITMAP_OFFSET(p)) |
#define | MARKED_IN_BITMAP(bits, p) ((bits)[BITMAP_INDEX(p)] & BITMAP_BIT(p)) |
#define | MARK_IN_BITMAP(bits, p) ((bits)[BITMAP_INDEX(p)] = (bits)[BITMAP_INDEX(p)] | BITMAP_BIT(p)) |
#define | CLEAR_IN_BITMAP(bits, p) ((bits)[BITMAP_INDEX(p)] = (bits)[BITMAP_INDEX(p)] & ~BITMAP_BIT(p)) |
#define | GET_HEAP_MARK_BITS(x) (&GET_HEAP_PAGE(x)->mark_bits[0]) |
#define | GET_HEAP_UNCOLLECTIBLE_BITS(x) (&GET_HEAP_PAGE(x)->uncollectible_bits[0]) |
#define | GET_HEAP_WB_UNPROTECTED_BITS(x) (&GET_HEAP_PAGE(x)->wb_unprotected_bits[0]) |
#define | GET_HEAP_MARKING_BITS(x) (&GET_HEAP_PAGE(x)->marking_bits[0]) |
#define | rb_objspace (*rb_objspace_of(GET_VM())) |
#define | rb_objspace_of(vm) ((vm)->objspace) |
#define | ruby_initial_gc_stress gc_params.gc_stress |
#define | malloc_limit objspace->malloc_params.limit |
#define | malloc_increase objspace->malloc_params.increase |
#define | malloc_allocated_size objspace->malloc_params.allocated_size |
#define | heap_pages_sorted objspace->heap_pages.sorted |
#define | heap_allocated_pages objspace->heap_pages.allocated_pages |
#define | heap_pages_sorted_length objspace->heap_pages.sorted_length |
#define | heap_pages_lomem objspace->heap_pages.range[0] |
#define | heap_pages_himem objspace->heap_pages.range[1] |
#define | heap_allocatable_pages objspace->heap_pages.allocatable_pages |
#define | heap_pages_freeable_pages objspace->heap_pages.freeable_pages |
#define | heap_pages_final_slots objspace->heap_pages.final_slots |
#define | heap_pages_deferred_final objspace->heap_pages.deferred_final |
#define | heap_eden (&objspace->eden_heap) |
#define | heap_tomb (&objspace->tomb_heap) |
#define | dont_gc objspace->flags.dont_gc |
#define | during_gc objspace->flags.during_gc |
#define | finalizing objspace->atomic_flags.finalizing |
#define | finalizer_table objspace->finalizer_table |
#define | global_list objspace->global_list |
#define | ruby_gc_stressful objspace->flags.gc_stressful |
#define | ruby_gc_stress_mode objspace->gc_stress_mode |
#define | stress_to_class 0 |
#define | gc_mode(objspace) gc_mode_verify((enum gc_mode)(objspace)->flags.mode) |
#define | gc_mode_set(objspace, mode) ((objspace)->flags.mode = (unsigned int)gc_mode_verify(mode)) |
#define | is_marking(objspace) (gc_mode(objspace) == gc_mode_marking) |
#define | is_sweeping(objspace) (gc_mode(objspace) == gc_mode_sweeping) |
#define | is_full_marking(objspace) ((objspace)->flags.during_minor_gc == FALSE) |
#define | is_incremental_marking(objspace) ((objspace)->flags.during_incremental_marking != FALSE) |
#define | will_be_incremental_marking(objspace) ((objspace)->rgengc.need_major_gc != GPR_FLAG_NONE) |
#define | has_sweeping_pages(heap) ((heap)->sweep_pages != 0) |
#define | is_lazy_sweeping(heap) (GC_ENABLE_LAZY_SWEEP && has_sweeping_pages(heap)) |
#define | nonspecial_obj_id(obj) (VALUE)((SIGNED_VALUE)(obj)|FIXNUM_FLAG) |
#define | obj_id_to_ref(objid) ((objid) ^ FIXNUM_FLAG) /* unset FIXNUM_FLAG */ |
#define | RANY(o) ((RVALUE*)(o)) |
#define | RZOMBIE(o) ((struct RZombie *)(o)) |
#define | nomem_error GET_VM()->special_exceptions[ruby_error_nomemory] |
#define | gc_prof_record(objspace) (objspace)->profile.current_record |
#define | gc_prof_enabled(objspace) ((objspace)->profile.run && (objspace)->profile.current_record) |
#define | gc_report if (!(RGENGC_DEBUG)) {} else gc_report_body |
#define | PUSH_MARK_FUNC_DATA(v) |
#define | POP_MARK_FUNC_DATA() objspace->mark_func_data = prev_mark_func_data;} while (0) |
#define | MEASURE_LINE(expr) expr |
#define | FL_TEST2(x, f) ((RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) ? (rb_bug("FL_TEST2: SPECIAL_CONST (%p)", (void *)(x)), 0) : FL_TEST_RAW((x),(f)) != 0) |
#define | FL_SET2(x, f) do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_SET2: SPECIAL_CONST"); RBASIC(x)->flags |= (f);} while (0) |
#define | FL_UNSET2(x, f) do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_UNSET2: SPECIAL_CONST"); RBASIC(x)->flags &= ~(f);} while (0) |
#define | RVALUE_MARK_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(obj), (obj)) |
#define | RVALUE_PAGE_MARKED(page, obj) MARKED_IN_BITMAP((page)->mark_bits, (obj)) |
#define | RVALUE_WB_UNPROTECTED_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(obj), (obj)) |
#define | RVALUE_UNCOLLECTIBLE_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS(obj), (obj)) |
#define | RVALUE_MARKING_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), (obj)) |
#define | RVALUE_PAGE_WB_UNPROTECTED(page, obj) MARKED_IN_BITMAP((page)->wb_unprotected_bits, (obj)) |
#define | RVALUE_PAGE_UNCOLLECTIBLE(page, obj) MARKED_IN_BITMAP((page)->uncollectible_bits, (obj)) |
#define | RVALUE_PAGE_MARKING(page, obj) MARKED_IN_BITMAP((page)->marking_bits, (obj)) |
#define | RVALUE_OLD_AGE 3 |
#define | RVALUE_AGE_SHIFT 5 /* FL_PROMOTED0 bit */ |
#define | gc_event_hook_available_p(objspace) ((objspace)->flags.has_hook) |
#define | gc_event_hook_needed_p(objspace, event) ((objspace)->hook_events & (event)) |
#define | gc_event_hook(objspace, event, data) |
#define | RESTORE_FINALIZER() |
#define | NUM2PTR(x) NUM2ULONG(x) |
#define | COUNT_TYPE(t) case (t): type = ID2SYM(rb_intern(#t)); break; |
#define | SET_STACK_END SET_MACHINE_STACK_END(&th->machine.stack_end) |
#define | STACK_START (th->machine.stack_start) |
#define | STACK_END (th->machine.stack_end) |
#define | STACK_LEVEL_MAX (th->machine.stack_maxsize/sizeof(VALUE)) |
#define | STACK_LENGTH |
#define | STACKFRAME_FOR_CALL_CFUNC 512 |
#define | GET_STACK_BOUNDS(start, end, appendix) |
#define | MARK_CHECKPOINT_PRINT_TICK(category) |
#define | MARK_CHECKPOINT(category) |
#define | PROFILE_REMEMBERSET_MARK 0 |
#define | I(s) ID_##s = rb_intern(#s); |
#define | MARK_OBJECT_ARY_BUCKET_SIZE 1024 |
#define | GC_NOTIFY 0 |
#define | gc_stress_full_mark_after_malloc_p() (FIXNUM_P(ruby_gc_stress_mode) && (FIX2LONG(ruby_gc_stress_mode) & (1<<gc_stress_full_mark_after_malloc))) |
#define | S(s) sym_##s = ID2SYM(rb_intern_const(#s)) |
#define | SET(name, attr) |
#define | S(s) gc_stat_symbols[gc_stat_sym_##s] = ID2SYM(rb_intern_const(#s)) |
#define | S(s) gc_stat_compat_symbols[gc_stat_compat_sym_##s] = ID2SYM(rb_intern_const(#s)) |
#define | OLD_SYM(s) gc_stat_compat_symbols[gc_stat_compat_sym_##s] |
#define | NEW_SYM(s) gc_stat_symbols[gc_stat_sym_##s] |
#define | SET(name, attr) |
#define | TRY_WITH_GC(alloc) |
#define | WMAP_DELETE_DEAD_OBJECT_IN_MARK 0 |
#define | GC_PROFILE_RECORD_DEFAULT_SIZE 100 |
#define | RUBY_DTRACE_GC_HOOK(name) do {if (RUBY_DTRACE_GC_##name##_ENABLED()) RUBY_DTRACE_GC_##name();} while (0) |
#define | TYPE_NAME(t) case (t): return #t; |
#define | ARY_SHARED_P(ary) |
#define | ARY_EMBED_P(ary) |
#define | TF(c) ((c) != 0 ? "true" : "false") |
#define | C(c, s) ((c) != 0 ? (s) : " ") |
#define | IMEMO_NAME(x) case imemo_##x: imemo_name = #x; break; |
#define | OPT(o) if (o) rb_ary_push(opts, rb_fstring_lit(#o)) |
Typedefs | |
typedef struct gc_profile_record | gc_profile_record |
typedef struct RVALUE | RVALUE |
typedef uintptr_t | bits_t |
typedef struct stack_chunk | stack_chunk_t |
typedef struct mark_stack | mark_stack_t |
typedef struct rb_heap_struct | rb_heap_t |
typedef struct rb_objspace | rb_objspace_t |
typedef int | each_obj_callback(void *, void *, size_t, void *) |
Variables | |
volatile VALUE | rb_gc_guarded_val |
static ruby_gc_params_t | gc_params |
VALUE * | ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress |
int | ruby_gc_debug_indent = 0 |
VALUE | rb_mGC |
int | ruby_disable_gc = 0 |
int | ruby_stack_grow_direction |
static st_table * | rgengc_unprotect_logging_table |
static VALUE | gc_stat_symbols [gc_stat_sym_last] |
static VALUE | gc_stat_compat_symbols [gc_stat_compat_sym_last] |
static VALUE | gc_stat_compat_table |
static const rb_data_type_t | weakmap_type |
#define ARY_EMBED_P | ( | ary | ) |
Definition at line 9203 of file gc.c.
Referenced by rb_raw_obj_info().
#define ARY_SHARED_P | ( | ary | ) |
Definition at line 9200 of file gc.c.
Referenced by rb_raw_obj_info().
#define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS |
Definition at line 65 of file gc.c.
Referenced by ruby_stack_check().
#define BITMAP_BIT | ( | p | ) | ((bits_t)1 << BITMAP_OFFSET(p)) |
Definition at line 694 of file gc.c.
Referenced by gc_page_sweep().
#define BITMAP_INDEX | ( | p | ) | (NUM_IN_PAGE(p) / BITS_BITLENGTH ) |
Definition at line 692 of file gc.c.
Referenced by gc_page_sweep().
#define BITMAP_OFFSET | ( | p | ) | (NUM_IN_PAGE(p) & (BITS_BITLENGTH-1)) |
#define C | ( | c, | |
s | |||
) | ((c) != 0 ? (s) : " ") |
Referenced by cont_restore_1(), gc_profile_record_get(), and rb_raw_obj_info().
#define CALC_EXACT_MALLOC_SIZE 0 |
Definition at line 303 of file gc.c.
Referenced by gc_profile_dump_on(), and Init_GC().
#define CLEAR_IN_BITMAP | ( | bits, | |
p | |||
) | ((bits)[BITMAP_INDEX(p)] = (bits)[BITMAP_INDEX(p)] & ~BITMAP_BIT(p)) |
Definition at line 699 of file gc.c.
Referenced by gc_mark_stacked_objects(), obj_free(), rb_gc_force_recycle(), RVALUE_DEMOTE(), and RVALUE_DEMOTE_RAW().
Referenced by count_objects().
#define dont_gc objspace->flags.dont_gc |
Definition at line 736 of file gc.c.
Referenced by garbage_collect_with_gvl(), gc_mark_roots(), gc_marks_continue(), gc_sweep_continue(), newobj_slowpath(), objspace_malloc_increase(), rb_gc_disable(), rb_gc_enable(), rb_objspace_call_finalizer(), and ready_to_gc().
#define during_gc objspace->flags.during_gc |
Definition at line 737 of file gc.c.
Referenced by gc_enter(), gc_exit(), gc_report_body(), gc_start(), newobj_of(), newobj_slowpath(), rb_during_gc(), rb_memerror(), and ready_to_gc().
#define finalizer_table objspace->finalizer_table |
Definition at line 739 of file gc.c.
Referenced by define_final0(), gc_mark_roots(), Init_heap(), rb_gc_copy_finalizer(), rb_objspace_call_finalizer(), rb_undefine_finalizer(), and run_final().
#define finalizing objspace->atomic_flags.finalizing |
Definition at line 738 of file gc.c.
Referenced by gc_finalize_deferred(), gc_page_sweep(), gc_verify_internal_consistency(), and rb_objspace_call_finalizer().
#define FL_SET2 | ( | x, | |
f | |||
) | do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_SET2: SPECIAL_CONST"); RBASIC(x)->flags |= (f);} while (0) |
#define FL_TEST2 | ( | x, | |
f | |||
) | ((RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) ? (rb_bug("FL_TEST2: SPECIAL_CONST (%p)", (void *)(x)), 0) : FL_TEST_RAW((x),(f)) != 0) |
#define FL_UNSET2 | ( | x, | |
f | |||
) | do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_UNSET2: SPECIAL_CONST"); RBASIC(x)->flags &= ~(f);} while (0) |
#define GC_ENABLE_INCREMENTAL_MARK USE_RINCGC |
Definition at line 297 of file gc.c.
Referenced by gc_start().
#define GC_ENABLE_LAZY_SWEEP 1 |
Definition at line 300 of file gc.c.
Referenced by gc_start(), and Init_GC().
#define gc_event_hook | ( | objspace, | |
event, | |||
data | |||
) |
Definition at line 1776 of file gc.c.
Referenced by gc_enter(), gc_exit(), gc_marks_finish(), gc_start(), gc_sweep_finish(), newobj_slowpath(), and obj_free().
#define gc_event_hook_available_p | ( | objspace | ) | ((objspace)->flags.has_hook) |
Definition at line 1773 of file gc.c.
Referenced by newobj_of().
#define gc_event_hook_needed_p | ( | objspace, | |
event | |||
) | ((objspace)->hook_events & (event)) |
#define gc_mode | ( | objspace | ) | gc_mode_verify((enum gc_mode)(objspace)->flags.mode) |
Definition at line 765 of file gc.c.
Referenced by gc_info_decode(), gc_mode_transition(), and gc_start().
#define gc_mode_set | ( | objspace, | |
mode | |||
) | ((objspace)->flags.mode = (unsigned int)gc_mode_verify(mode)) |
Definition at line 766 of file gc.c.
Referenced by gc_mode_transition().
#define gc_prof_enabled | ( | objspace | ) | ((objspace)->profile.run && (objspace)->profile.current_record) |
Definition at line 893 of file gc.c.
Referenced by gc_page_sweep(), gc_prof_mark_timer_start(), gc_prof_mark_timer_stop(), gc_prof_set_heap_info(), gc_prof_set_malloc_info(), gc_prof_sweep_timer_start(), gc_prof_sweep_timer_stop(), gc_prof_timer_start(), and gc_prof_timer_stop().
#define gc_prof_record | ( | objspace | ) | (objspace)->profile.current_record |
Definition at line 892 of file gc.c.
Referenced by gc_marks(), gc_page_sweep(), gc_prof_mark_timer_start(), gc_prof_mark_timer_stop(), gc_prof_set_heap_info(), gc_prof_set_malloc_info(), gc_prof_sweep_timer_start(), gc_prof_sweep_timer_stop(), gc_prof_timer_start(), and gc_prof_timer_stop().
#define GC_PROFILE_DETAIL_MEMORY 0 |
Definition at line 294 of file gc.c.
Referenced by gc_profile_dump_on(), and Init_GC().
#define GC_PROFILE_MORE_DETAIL 0 |
Definition at line 291 of file gc.c.
Referenced by gc_prof_sweep_timer_start(), gc_prof_sweep_timer_stop(), and Init_GC().
#define GC_PROFILE_RECORD_DEFAULT_SIZE 100 |
Definition at line 8526 of file gc.c.
Referenced by gc_prof_setup_new_record(), and gc_profile_clear().
#define gc_report if (!(RGENGC_DEBUG)) {} else gc_report_body |
Definition at line 899 of file gc.c.
Referenced by gc_aging(), gc_enter(), gc_exit(), gc_marks_continue(), gc_marks_finish(), gc_marks_rest(), gc_marks_start(), gc_marks_wb_unprotected_objects(), gc_page_sweep(), gc_start(), gc_sweep(), gc_sweep_continue(), gc_sweep_finish(), gc_sweep_step(), gc_verify_internal_consistency(), gc_writebarrier_generational(), gc_writebarrier_incremental(), heap_increment(), heap_page_add_freeobj(), heap_page_allocate(), heap_pages_expand_sorted_to(), heap_set_increment(), newobj_init(), rb_gc_force_recycle(), rb_gc_writebarrier_remember(), rb_gc_writebarrier_unprotect(), rgengc_check_relation(), rgengc_remember(), rgengc_remembered(), and rgengc_rememberset_mark().
#define gc_stress_full_mark_after_malloc_p | ( | ) | (FIXNUM_P(ruby_gc_stress_mode) && (FIX2LONG(ruby_gc_stress_mode) & (1<<gc_stress_full_mark_after_malloc))) |
Definition at line 6217 of file gc.c.
Referenced by objspace_malloc_gc_stress().
#define GET_HEAP_MARK_BITS | ( | x | ) | (&GET_HEAP_PAGE(x)->mark_bits[0]) |
Definition at line 702 of file gc.c.
Referenced by gc_mark_roots(), gc_mark_set(), gc_writebarrier_generational(), is_garbage_object(), rb_gc_force_recycle(), rb_obj_gc_flags(), and rb_obj_info_dump().
#define GET_HEAP_MARKING_BITS | ( | x | ) | (&GET_HEAP_PAGE(x)->marking_bits[0]) |
Definition at line 706 of file gc.c.
Referenced by gc_grey(), gc_mark_stacked_objects(), rb_gc_force_recycle(), rb_obj_gc_flags(), and RVALUE_DEMOTE().
#define GET_HEAP_PAGE | ( | x | ) | (GET_PAGE_HEADER(x)->page) |
Definition at line 689 of file gc.c.
Referenced by finalize_list(), gc_aging(), gc_remember_unprotected(), heap_is_swept_object(), rb_gc_force_recycle(), rgengc_remembersetbits_set(), and RVALUE_OLD_UNCOLLECTIBLE_SET().
#define GET_HEAP_UNCOLLECTIBLE_BITS | ( | x | ) | (&GET_HEAP_PAGE(x)->uncollectible_bits[0]) |
Definition at line 704 of file gc.c.
Referenced by rb_gc_force_recycle(), and RVALUE_DEMOTE_RAW().
#define GET_HEAP_WB_UNPROTECTED_BITS | ( | x | ) | (&GET_HEAP_PAGE(x)->wb_unprotected_bits[0]) |
Definition at line 705 of file gc.c.
Referenced by newobj_init(), obj_free(), rb_copy_wb_protected_attribute(), rb_gc_force_recycle(), and rb_gc_writebarrier_unprotect().
#define GET_PAGE_BODY | ( | x | ) | ((struct heap_page_body *)((bits_t)(x) & ~(HEAP_PAGE_ALIGN_MASK))) |
Definition at line 687 of file gc.c.
Referenced by heap_page_free().
#define GET_PAGE_HEADER | ( | x | ) | (&GET_PAGE_BODY(x)->header) |
#define GET_STACK_BOUNDS | ( | start, | |
end, | |||
appendix | |||
) |
Definition at line 4168 of file gc.c.
Referenced by mark_current_machine_context(), and rb_gc_mark_machine_stack().
#define global_list objspace->global_list |
Definition at line 740 of file gc.c.
Referenced by gc_mark_roots(), rb_gc_register_address(), rb_gc_unregister_address(), and rb_objspace_free().
#define has_sweeping_pages | ( | heap | ) | ((heap)->sweep_pages != 0) |
Definition at line 785 of file gc.c.
Referenced by gc_sweep_rest().
#define heap_allocatable_pages objspace->heap_pages.allocatable_pages |
Definition at line 730 of file gc.c.
Referenced by gc_marks_finish(), gc_stat_internal(), gc_sweep_finish(), heap_add_pages(), heap_extend_pages(), heap_increment(), heap_pages_expand_sorted(), heap_set_increment(), and setup_gc_stat_symbols().
#define heap_allocated_pages objspace->heap_pages.allocated_pages |
Definition at line 726 of file gc.c.
Referenced by count_objects(), gc_start(), gc_stat_internal(), heap_extend_pages(), heap_page_allocate(), heap_page_create(), heap_page_free(), heap_pages_free_unused_pages(), heap_set_increment(), is_pointer_to_heap(), objspace_each_objects(), rb_objspace_call_finalizer(), rb_objspace_free(), and setup_gc_stat_symbols().
#define heap_eden (&objspace->eden_heap) |
Definition at line 734 of file gc.c.
Referenced by gc_current_status_fill(), gc_marks_finish(), gc_marks_rest(), gc_marks_start(), gc_marks_wb_unprotected_objects(), gc_report_body(), gc_rest(), gc_set_initial_pages(), gc_start(), gc_stat_internal(), gc_sweep(), gc_sweep_rest(), gc_sweep_start(), gc_verify_heap_pages(), gc_verify_internal_consistency(), heap_pages_expand_sorted(), heap_set_increment(), Init_heap(), is_garbage_object(), is_swept_object(), newobj_of(), newobj_slowpath(), objspace_available_slots(), objspace_malloc_increase(), rb_obj_info_dump(), rb_objspace_free(), and ready_to_gc().
#define heap_pages_deferred_final objspace->heap_pages.deferred_final |
Definition at line 733 of file gc.c.
Referenced by finalize_deferred(), gc_page_sweep(), gc_prof_sweep_timer_stop(), gc_verify_internal_consistency(), make_zombie(), and rb_objspace_call_finalizer().
#define heap_pages_final_slots objspace->heap_pages.final_slots |
Definition at line 732 of file gc.c.
Referenced by finalize_list(), gc_page_sweep(), gc_stat_internal(), gc_verify_internal_consistency(), objspace_free_slots(), and objspace_live_slots().
#define heap_pages_freeable_pages objspace->heap_pages.freeable_pages |
Definition at line 731 of file gc.c.
Referenced by gc_marks_finish(), and gc_sweep_step().
#define heap_pages_himem objspace->heap_pages.range[1] |
Definition at line 729 of file gc.c.
Referenced by heap_page_allocate(), is_pointer_to_heap(), and rb_objspace_free().
#define heap_pages_lomem objspace->heap_pages.range[0] |
Definition at line 728 of file gc.c.
Referenced by heap_page_allocate(), and rb_objspace_free().
#define heap_pages_sorted objspace->heap_pages.sorted |
Definition at line 725 of file gc.c.
Referenced by count_objects(), heap_page_allocate(), heap_pages_expand_sorted_to(), heap_pages_free_unused_pages(), is_pointer_to_heap(), objspace_each_objects(), rb_objspace_call_finalizer(), and rb_objspace_free().
#define heap_pages_sorted_length objspace->heap_pages.sorted_length |
Definition at line 727 of file gc.c.
Referenced by gc_stat_internal(), heap_increment(), heap_page_allocate(), heap_page_create(), heap_pages_expand_sorted(), heap_pages_expand_sorted_to(), and rb_objspace_free().
#define heap_tomb (&objspace->tomb_heap) |
Definition at line 735 of file gc.c.
Referenced by gc_stat_internal(), gc_sweep_finish(), gc_sweep_step(), gc_verify_heap_pages(), heap_add_page(), heap_page_create(), heap_page_resurrect(), heap_pages_expand_sorted(), heap_pages_free_unused_pages(), and objspace_available_slots().
#define I | ( | s | ) | ID_##s = rb_intern(#s); |
Referenced by rb_obj_gc_flags().
#define IMEMO_NAME | ( | x | ) | case imemo_##x: imemo_name = #x; break; |
Referenced by rb_raw_obj_info().
#define is_full_marking | ( | objspace | ) | ((objspace)->flags.during_minor_gc == FALSE) |
Definition at line 771 of file gc.c.
Referenced by check_rvalue_consistency(), gc_aging(), gc_current_status_fill(), gc_marks_finish(), gc_page_sweep(), gc_report_body(), and gc_reset_malloc_info().
#define is_incremental_marking | ( | objspace | ) | ((objspace)->flags.during_incremental_marking != FALSE) |
Definition at line 776 of file gc.c.
Referenced by check_rvalue_consistency(), gc_current_status_fill(), gc_grey(), gc_marks(), gc_marks_finish(), gc_marks_rest(), gc_report_body(), gc_rest(), gc_start(), gc_verify_heap_page(), gc_writebarrier_generational(), heap_prepare(), newobj_init(), rb_gc_force_recycle(), rb_gc_writebarrier(), rb_gc_writebarrier_remember(), rgengc_check_relation(), rgengc_remembersetbits_set(), RVALUE_DEMOTE(), and verify_internal_consistency_i().
#define is_lazy_sweeping | ( | heap | ) | (GC_ENABLE_LAZY_SWEEP && has_sweeping_pages(heap)) |
Definition at line 786 of file gc.c.
Referenced by gc_current_status_fill(), gc_report_body(), gc_rest(), gc_start(), gc_verify_internal_consistency(), heap_prepare(), is_garbage_object(), objspace_malloc_increase(), rb_obj_info_dump(), and rb_objspace_free().
#define is_marking | ( | objspace | ) | (gc_mode(objspace) == gc_mode_marking) |
Definition at line 768 of file gc.c.
Referenced by check_rvalue_consistency(), gc_current_status_fill(), gc_marks_step(), gc_verify_internal_consistency(), and verify_internal_consistency_i().
#define is_sweeping | ( | objspace | ) | (gc_mode(objspace) == gc_mode_sweeping) |
Definition at line 769 of file gc.c.
Referenced by gc_current_status_fill().
#define malloc_allocated_size objspace->malloc_params.allocated_size |
Definition at line 724 of file gc.c.
Referenced by gc_prof_setup_new_record().
#define malloc_increase objspace->malloc_params.increase |
Definition at line 723 of file gc.c.
Referenced by gc_prof_set_malloc_info(), gc_reset_malloc_info(), gc_stat_internal(), objspace_malloc_increase(), and setup_gc_stat_symbols().
#define malloc_limit objspace->malloc_params.limit |
Definition at line 722 of file gc.c.
Referenced by gc_prof_set_malloc_info(), gc_reset_malloc_info(), gc_stat_internal(), objspace_malloc_increase(), rb_objspace_alloc(), and setup_gc_stat_symbols().
#define MARK_CHECKPOINT | ( | category | ) |
Referenced by gc_mark_roots().
#define MARK_CHECKPOINT_PRINT_TICK | ( | category | ) |
#define MARK_IN_BITMAP | ( | bits, | |
p | |||
) | ((bits)[BITMAP_INDEX(p)] = (bits)[BITMAP_INDEX(p)] | BITMAP_BIT(p)) |
Definition at line 698 of file gc.c.
Referenced by gc_grey(), gc_mark_set(), gc_remember_unprotected(), gc_writebarrier_generational(), newobj_init(), rb_copy_wb_protected_attribute(), rb_gc_writebarrier_unprotect(), rgengc_remembersetbits_set(), and RVALUE_PAGE_OLD_UNCOLLECTIBLE_SET().
#define MARK_OBJECT_ARY_BUCKET_SIZE 1024 |
Definition at line 6150 of file gc.c.
Referenced by rb_gc_register_mark_object().
#define MARKED_IN_BITMAP | ( | bits, | |
p | |||
) | ((bits)[BITMAP_INDEX(p)] & BITMAP_BIT(p)) |
Definition at line 697 of file gc.c.
Referenced by gc_mark_roots(), gc_remember_unprotected(), is_garbage_object(), rb_gc_force_recycle(), rb_obj_gc_flags(), rb_obj_info_dump(), and rgengc_remembersetbits_set().
#define NEW_SYM | ( | s | ) | gc_stat_symbols[gc_stat_sym_##s] |
Referenced by setup_gc_stat_symbols().
#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory] |
Definition at line 810 of file gc.c.
Referenced by rb_memerror().
#define nonspecial_obj_id | ( | obj | ) | (VALUE)((SIGNED_VALUE)(obj)|FIXNUM_FLAG) |
Definition at line 789 of file gc.c.
Referenced by rb_obj_id(), run_finalizer(), and wmap_aset().
#define NUM_IN_PAGE | ( | p | ) | (((bits_t)(p) & HEAP_PAGE_ALIGN_MASK)/sizeof(RVALUE)) |
Definition at line 691 of file gc.c.
Referenced by gc_marks_wb_unprotected_objects(), gc_page_sweep(), and rgengc_rememberset_mark().
#define obj_id_to_ref | ( | objid | ) | ((objid) ^ FIXNUM_FLAG) /* unset FIXNUM_FLAG */ |
Definition at line 790 of file gc.c.
Referenced by id2ref(), and wmap_finalize().
#define OLD_SYM | ( | s | ) | gc_stat_compat_symbols[gc_stat_compat_sym_##s] |
Referenced by setup_gc_stat_symbols().
#define OPT | ( | o | ) | if (o) rb_ary_push(opts, rb_fstring_lit(#o)) |
Referenced by Init_GC().
#define POP_MARK_FUNC_DATA | ( | ) | objspace->mark_func_data = prev_mark_func_data;} while (0) |
Definition at line 908 of file gc.c.
Referenced by gc_mark_roots(), gc_marks(), gc_marks_continue(), gc_rest(), rb_objspace_reachable_objects_from(), and rb_objspace_reachable_objects_from_root().
#define PUSH_MARK_FUNC_DATA | ( | v | ) |
Definition at line 904 of file gc.c.
Referenced by gc_mark_roots(), gc_marks(), gc_marks_continue(), gc_rest(), rb_objspace_reachable_objects_from(), and rb_objspace_reachable_objects_from_root().
#define RANY | ( | o | ) | ((RVALUE*)(o)) |
Definition at line 799 of file gc.c.
Referenced by gc_mark_children(), gc_mark_imemo(), is_pointer_to_heap(), make_io_zombie(), newobj_init(), obj_free(), rb_obj_info_dump(), rb_objspace_call_finalizer(), and rb_raw_obj_info().
#define rb_jmp_buf rb_jmpbuf_t |
Definition at line 90 of file gc.c.
Referenced by mark_current_machine_context().
#define rb_objspace (*rb_objspace_of(GET_VM())) |
Definition at line 711 of file gc.c.
Referenced by check_rvalue_consistency(), count_objects(), define_final0(), gc_latest_gc_info(), gc_profile_clear(), gc_profile_disable(), gc_profile_dump_on(), gc_profile_enable(), gc_profile_enable_get(), gc_profile_record_get(), gc_profile_total_time(), gc_set_initial_pages(), gc_start_internal(), gc_stat_internal(), gc_stress_get(), gc_stress_set_m(), gc_verify_internal_consistency(), id2ref(), incremental_enable(), Init_heap(), newobj_of(), objspace_each_objects(), rb_copy_wb_protected_attribute(), rb_during_gc(), rb_gc(), rb_gc_adjust_memory_usage(), rb_gc_copy_finalizer(), rb_gc_disable(), rb_gc_enable(), rb_gc_force_recycle(), rb_gc_latest_gc_info(), rb_gc_mark_values(), rb_gc_register_address(), rb_gc_unregister_address(), rb_gc_writebarrier(), rb_gc_writebarrier_remember(), rb_gc_writebarrier_unprotect(), rb_obj_info_dump(), rb_objspace_alloc(), rb_objspace_each_objects(), rb_objspace_garbage_object_p(), rb_objspace_markable_object_p(), rb_objspace_reachable_objects_from(), rb_objspace_reachable_objects_from_root(), rb_objspace_set_event_hook(), rb_undefine_finalizer(), ruby_gc_set_params(), wmap_aref(), wmap_each(), wmap_each_key(), wmap_each_value(), wmap_keys(), and wmap_values().
#define rb_objspace_of | ( | vm | ) | ((vm)->objspace) |
Definition at line 712 of file gc.c.
Referenced by rb_gc_mark_machine_stack(), and rb_memerror().
Definition at line 89 of file gc.c.
Referenced by mark_current_machine_context().
#define RESTORE_FINALIZER | ( | ) |
Referenced by run_finalizer().
#define RGENGC_CHECK_MODE 0 |
Definition at line 235 of file gc.c.
Referenced by check_generation_i(), gc_aging(), gc_enter(), gc_exit(), gc_mark_stacked_objects(), gc_marks_continue(), gc_marks_finish(), gc_marks_step(), gc_marks_wb_unprotected_objects(), gc_rest(), gc_start(), gc_sweep_continue(), gc_writebarrier_generational(), heap_get_freeobj_from_next_freepage(), heap_page_add_freeobj(), heap_pages_free_unused_pages(), heap_prepare(), Init_GC(), newobj_init(), objspace_malloc_increase(), pop_mark_stack_chunk(), push_mark_stack_chunk(), rb_gc_writebarrier(), rb_wb_protected_newobj_of(), rb_wb_unprotected_newobj_of(), rgengc_check_relation(), rgengc_remember(), rgengc_rememberset_mark(), rgengc_remembersetbits_set(), RVALUE_AGE_INC(), RVALUE_AGE_RESET(), RVALUE_AGE_SET_CANDIDATE(), RVALUE_AGE_SET_OLD(), RVALUE_DEMOTE(), and verify_internal_consistency_i().
#define RGENGC_DEBUG 0 |
Definition at line 223 of file gc.c.
Referenced by gc_report_body(), and Init_GC().
#define RGENGC_FORCE_MAJOR_GC 0 |
Definition at line 271 of file gc.c.
Referenced by gc_marks_finish(), and gc_start().
#define RGENGC_OBJ_INFO (RGENGC_DEBUG | RGENGC_CHECK_MODE) |
#define RGENGC_OLD_NEWOBJ_CHECK 0 |
Definition at line 245 of file gc.c.
Referenced by newobj_init().
#define RGENGC_PROFILE 0 |
Definition at line 254 of file gc.c.
Referenced by gc_profile_dump_on(), and Init_GC().
#define RUBY_DTRACE_GC_HOOK | ( | name | ) | do {if (RUBY_DTRACE_GC_##name##_ENABLED()) RUBY_DTRACE_GC_##name();} while (0) |
Definition at line 8665 of file gc.c.
Referenced by gc_prof_mark_timer_start(), gc_prof_mark_timer_stop(), gc_prof_sweep_timer_start(), and gc_prof_sweep_timer_stop().
#define ruby_gc_stress_mode objspace->gc_stress_mode |
Definition at line 742 of file gc.c.
Referenced by gc_start(), and gc_stress_get().
#define ruby_gc_stressful objspace->flags.gc_stressful |
Definition at line 741 of file gc.c.
Referenced by gc_prof_setup_new_record(), gc_start(), newobj_of(), newobj_slowpath(), and objspace_malloc_gc_stress().
#define ruby_initial_gc_stress gc_params.gc_stress |
Definition at line 718 of file gc.c.
Referenced by Init_heap().
#define RVALUE_AGE_SHIFT 5 /* FL_PROMOTED0 bit */ |
Definition at line 1026 of file gc.c.
Referenced by RVALUE_FLAGS_AGE(), and RVALUE_FLAGS_AGE_SET().
#define RVALUE_MARK_BITMAP | ( | obj | ) | MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(obj), (obj)) |
Definition at line 1013 of file gc.c.
Referenced by check_rvalue_consistency(), rb_raw_obj_info(), and RVALUE_MARKED().
#define RVALUE_MARKING_BITMAP | ( | obj | ) | MARKED_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), (obj)) |
Definition at line 1019 of file gc.c.
Referenced by check_rvalue_consistency(), rb_raw_obj_info(), RVALUE_MARKING(), and RVALUE_REMEMBERED().
#define RVALUE_OLD_AGE 3 |
Definition at line 1025 of file gc.c.
Referenced by check_rvalue_consistency(), gc_marks_finish(), RVALUE_AGE_INC(), RVALUE_AGE_SET_CANDIDATE(), and RVALUE_AGE_SET_OLD().
#define RVALUE_PAGE_MARKED | ( | page, | |
obj | |||
) | MARKED_IN_BITMAP((page)->mark_bits, (obj)) |
#define RVALUE_PAGE_MARKING | ( | page, | |
obj | |||
) | MARKED_IN_BITMAP((page)->marking_bits, (obj)) |
Definition at line 1023 of file gc.c.
Referenced by gc_verify_heap_page().
#define RVALUE_PAGE_UNCOLLECTIBLE | ( | page, | |
obj | |||
) | MARKED_IN_BITMAP((page)->uncollectible_bits, (obj)) |
Definition at line 1022 of file gc.c.
Referenced by gc_aging(), and gc_verify_heap_page().
#define RVALUE_PAGE_WB_UNPROTECTED | ( | page, | |
obj | |||
) | MARKED_IN_BITMAP((page)->wb_unprotected_bits, (obj)) |
Definition at line 1021 of file gc.c.
Referenced by gc_aging(), and gc_verify_heap_page().
#define RVALUE_UNCOLLECTIBLE_BITMAP | ( | obj | ) | MARKED_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS(obj), (obj)) |
Definition at line 1018 of file gc.c.
Referenced by check_rvalue_consistency(), rb_raw_obj_info(), and RVALUE_UNCOLLECTIBLE().
#define RVALUE_WB_UNPROTECTED_BITMAP | ( | obj | ) | MARKED_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(obj), (obj)) |
Definition at line 1017 of file gc.c.
Referenced by check_rvalue_consistency(), rb_raw_obj_info(), and RVALUE_WB_UNPROTECTED().
#define RZOMBIE | ( | o | ) | ((struct RZombie *)(o)) |
Definition at line 808 of file gc.c.
Referenced by finalize_list(), gc_verify_internal_consistency(), make_zombie(), and run_final().
#define S | ( | s | ) | sym_##s = ID2SYM(rb_intern_const(#s)) |
Referenced by gc_info_decode(), gc_profile_record_get(), ruby_dtoa(), and setup_gc_stat_symbols().
#define S | ( | s | ) | gc_stat_symbols[gc_stat_sym_##s] = ID2SYM(rb_intern_const(#s)) |
#define S | ( | s | ) | gc_stat_compat_symbols[gc_stat_compat_sym_##s] = ID2SYM(rb_intern_const(#s)) |
#define SET | ( | name, | |
attr | |||
) |
Referenced by gc_info_decode(), and gc_stat_internal().
#define SET | ( | name, | |
attr | |||
) |
#define SET_STACK_END SET_MACHINE_STACK_END(&th->machine.stack_end) |
Definition at line 3918 of file gc.c.
Referenced by gc_mark_roots(), mark_current_machine_context(), ruby_stack_length(), and stack_check().
#define STACK_CHUNK_SIZE 500 |
Definition at line 464 of file gc.c.
Referenced by init_mark_stack().
#define STACK_END (th->machine.stack_end) |
Definition at line 3922 of file gc.c.
Referenced by ruby_stack_length().
#define STACK_LENGTH |
#define STACK_LEVEL_MAX (th->machine.stack_maxsize/sizeof(VALUE)) |
Definition at line 3923 of file gc.c.
Referenced by stack_check().
#define STACK_START (th->machine.stack_start) |
Definition at line 3921 of file gc.c.
Referenced by ruby_stack_length().
#define STACKFRAME_FOR_CALL_CFUNC 512 |
Definition at line 3973 of file gc.c.
Referenced by ruby_stack_check().
#define stress_to_class 0 |
Definition at line 746 of file gc.c.
Referenced by gc_mark_roots(), newobj_of(), and rb_obj_info_dump().
#define TF | ( | c | ) | ((c) != 0 ? "true" : "false") |
#define TRY_WITH_GC | ( | alloc | ) |
Definition at line 7824 of file gc.c.
Referenced by objspace_xcalloc(), objspace_xmalloc0(), and objspace_xrealloc().
#define TYPE_NAME | ( | t | ) | case (t): return #t; |
Referenced by type_name().
#define USE_TICK_T (PRINT_ENTER_EXIT_TICK || PRINT_MEASURE_LINE || PRINT_ROOT_TICKS) |
#define will_be_incremental_marking | ( | objspace | ) | ((objspace)->rgengc.need_major_gc != GPR_FLAG_NONE) |
Definition at line 781 of file gc.c.
Referenced by gc_sweep_step(), and heap_prepare().
typedef struct gc_profile_record gc_profile_record |
typedef struct mark_stack mark_stack_t |
typedef struct rb_heap_struct rb_heap_t |
typedef struct rb_objspace rb_objspace_t |
typedef struct stack_chunk stack_chunk_t |
anonymous enum |
anonymous enum |
enum gc_mode |
enum gc_stat_compat_sym |
enum gc_stat_sym |
enum memop_type |
|
static |
Definition at line 3776 of file gc.c.
References mark_stack::cache, mark_stack::cache_size, and stack_chunk::next.
Referenced by init_mark_stack(), and pop_mark_stack_chunk().
|
static |
Definition at line 7680 of file gc.c.
References free().
Referenced by heap_page_allocate(), and heap_page_free().
|
static |
|
inlinestatic |
Definition at line 7710 of file gc.c.
References ATOMIC_SIZE_CAS, and val.
Referenced by objspace_malloc_increase().
Definition at line 5077 of file gc.c.
References check_rvalue_consistency().
Referenced by verify_internal_consistency_i().
Definition at line 5063 of file gc.c.
References verify_internal_consistency_struct::err_count, obj_info(), verify_internal_consistency_struct::parent, RVALUE_WB_UNPROTECTED(), and RVALUE_WHITE_P().
Referenced by verify_internal_consistency_i().
Definition at line 5045 of file gc.c.
References assert, verify_internal_consistency_struct::err_count, obj_info(), verify_internal_consistency_struct::parent, RGENGC_CHECK_MODE, RVALUE_OLD_P(), RVALUE_REMEMBERED(), and RVALUE_UNCOLLECTIBLE().
Referenced by verify_internal_consistency_i().
Definition at line 1044 of file gc.c.
References BUILTIN_TYPE, FALSE, RBasic::flags, is_full_marking, is_incremental_marking, is_marking, is_pointer_to_heap(), obj_info(), obj_memsize_of(), rb_bug(), rb_objspace, RBASIC, RVALUE_FLAGS_AGE(), RVALUE_MARK_BITMAP, RVALUE_MARKING_BITMAP, RVALUE_OLD_AGE, RVALUE_UNCOLLECTIBLE_BITMAP, RVALUE_WB_UNPROTECTED_BITMAP, SPECIAL_CONST_P, T_NONE, and T_ZOMBIE.
Referenced by check_children_i(), gc_aging(), gc_writebarrier_generational(), is_markable_object(), newobj_init(), rb_copy_wb_protected_attribute(), rgengc_remember(), rgengc_remembered(), RVALUE_AGE_INC(), RVALUE_AGE_RESET(), RVALUE_AGE_SET_CANDIDATE(), RVALUE_AGE_SET_OLD(), RVALUE_DEMOTE(), RVALUE_MARKED(), RVALUE_MARKING(), RVALUE_OLD_P(), RVALUE_REMEMBERED(), RVALUE_UNCOLLECTIBLE(), and RVALUE_WB_UNPROTECTED().
Definition at line 7016 of file gc.c.
References NIL_P, PRIsVALUE, rb_hash_lookup(), and rb_warn().
Referenced by default_proc_for_compat_func(), and gc_stat_internal().
Definition at line 3316 of file gc.c.
References RVALUE::as, RVALUE::basic, BUILTIN_TYPE, COUNT_TYPE, RBasic::flags, hash(), heap_allocated_pages, heap_pages_sorted, ID2SYM, INT2NUM, Qnil, rb_eTypeError, rb_hash_aset(), rb_hash_new(), rb_intern, rb_objspace, rb_raise(), rb_scan_args(), RB_TYPE_P, RHASH_EMPTY_P, RHASH_TBL_RAW, set_zero(), SIZET2NUM, st_foreach, heap_page::start, T_ARRAY, T_BIGNUM, T_CLASS, T_COMPLEX, T_DATA, T_FALSE, T_FILE, T_FIXNUM, T_FLOAT, T_HASH, T_ICLASS, T_IMEMO, T_MASK, T_MATCH, T_MODULE, T_NIL, T_NODE, T_NONE, T_OBJECT, T_RATIONAL, T_REGEXP, T_STRING, T_STRUCT, T_SYMBOL, T_TRUE, T_UNDEF, T_ZOMBIE, and heap_page::total_slots.
Referenced by Init_GC().
Definition at line 7035 of file gc.c.
References Check_Type, compat_key(), key, Qnil, rb_check_arity, rb_hash_lookup(), and T_HASH.
Referenced by gc_stat_internal().
Definition at line 2635 of file gc.c.
References define_final0(), rb_block_proc(), rb_scan_args(), should_be_callable(), and should_be_finalizable().
Referenced by Init_GC().
Definition at line 2652 of file gc.c.
References finalizer_table, FL_FINALIZE, idEq, INT2FIX, len, OBJ_FREEZE, RARRAY_CONST_PTR, RARRAY_LEN, rb_ary_new3, rb_ary_push(), rb_funcall(), rb_objspace, rb_safe_level(), RBASIC, RBASIC_CLEAR_CLASS, st_add_direct, st_data_t, st_lookup, and code_page_table::table.
Referenced by define_final(), rb_define_finalizer(), and wmap_aset().
|
static |
Definition at line 8644 of file gc.c.
References getrusage_time().
Referenced by gc_prof_mark_timer_stop(), gc_prof_sweep_timer_stop(), and gc_prof_timer_stop().
|
static |
Definition at line 2798 of file gc.c.
References ATOMIC_VALUE_EXCHANGE, finalize_list(), and heap_pages_deferred_final.
Referenced by gc_finalize_deferred(), and rb_objspace_call_finalizer().
|
static |
Definition at line 2777 of file gc.c.
References heap_page::final_slots, heap_page::free_slots, GET_HEAP_PAGE, heap_page_add_freeobj(), heap_pages_final_slots, rb_objspace::profile, run_final(), RZOMBIE, and rb_objspace::total_freed_objects.
Referenced by finalize_deferred(), and rb_objspace_call_finalizer().
Definition at line 2838 of file gc.c.
References ALLOC, key, force_finalize_list::next, force_finalize_list::obj, ST_CONTINUE, force_finalize_list::table, and val.
Referenced by rb_objspace_call_finalizer().
|
static |
Definition at line 2083 of file gc.c.
References ID_TABLE_CONTINUE, and xfree().
Referenced by rb_free_const_table().
|
static |
Definition at line 3832 of file gc.c.
References mark_stack::chunk, free(), stack_chunk::next, heap_page::next, and NULL.
Referenced by gc_mark_roots(), rb_objspace_alloc(), and rb_objspace_free().
|
static |
Definition at line 6313 of file gc.c.
References gc_rest(), gc_start(), getrusage_time(), and rb_objspace::profile.
Referenced by garbage_collect_with_gvl(), gc_start_internal(), gc_with_gvl(), newobj_slowpath(), rb_garbage_collect(), and rb_gc().
|
static |
Definition at line 6555 of file gc.c.
References dont_gc, EXIT_FAILURE, objspace_and_reason::full_mark, garbage_collect(), gc_with_gvl(), objspace_and_reason::immediate_mark, objspace_and_reason::immediate_sweep, objspace_and_reason::objspace, rb_thread_call_with_gvl(), objspace_and_reason::reason, ruby_native_thread_p(), ruby_thread_has_gvl_p(), and TRUE.
Referenced by objspace_malloc_gc_stress(), and objspace_malloc_increase().
|
static |
Definition at line 4343 of file gc.c.
References assert, check_rvalue_consistency(), FALSE, gc_mark_ptr(), gc_report, GET_HEAP_PAGE, is_full_marking, rb_objspace::marked_slots, NOINLINE(), obj_info(), RGENGC_CHECK_MODE, RVALUE_AGE_INC(), RVALUE_MARKING(), RVALUE_OLD_P(), RVALUE_PAGE_OLD_UNCOLLECTIBLE_SET(), RVALUE_PAGE_UNCOLLECTIBLE, and RVALUE_PAGE_WB_UNPROTECTED.
Referenced by gc_mark_from(), and gc_mark_ptr().
Definition at line 6704 of file gc.c.
References rb_gc_count(), and SIZET2NUM.
Referenced by Init_GC().
|
static |
Definition at line 6470 of file gc.c.
References gc_current_status_fill(), gc_record(), GPR_FLAG_MAJOR_MASK, rb_objspace::latest_gc_info, and rb_objspace::profile.
Referenced by gc_enter(), and gc_exit().
|
static |
Definition at line 6447 of file gc.c.
References heap_eden, is_full_marking, is_incremental_marking, is_lazy_sweeping, is_marking, and is_sweeping.
Referenced by gc_current_status().
|
inlinestatic |
Definition at line 6525 of file gc.c.
References assert, during_gc, gc_current_status(), gc_event_hook, gc_record(), gc_report, gc_verify_internal_consistency(), Qnil, RGENGC_CHECK_MODE, RUBY_INTERNAL_EVENT_GC_ENTER, and TRUE.
Referenced by gc_marks_continue(), gc_rest(), gc_start(), gc_sweep_continue(), and rb_objspace_call_finalizer().
|
static |
Definition at line 1768 of file gc.c.
References rb_thread_struct::cfp, EXEC_EVENT_HOOK, and rb_control_frame_struct::self.
|
inlinestatic |
Definition at line 6537 of file gc.c.
References assert, during_gc, FALSE, gc_current_status(), gc_event_hook, gc_record(), gc_report, RGENGC_CHECK_MODE, and RUBY_INTERNAL_EVENT_GC_EXIT.
Referenced by gc_marks_continue(), gc_rest(), gc_start(), gc_sweep_continue(), rb_memerror(), and rb_objspace_call_finalizer().
|
static |
Definition at line 2808 of file gc.c.
References ATOMIC_EXCHANGE, ATOMIC_SET, finalize_deferred(), and finalizing.
Referenced by gc_finalize_deferred_register(), gc_start_internal(), rb_gc(), and rb_gc_finalize_deferred().
|
static |
Definition at line 2824 of file gc.c.
References gc_finalize_deferred(), rb_bug(), and rb_postponed_job_register_one().
Referenced by gc_page_sweep().
|
static |
Definition at line 4326 of file gc.c.
References FALSE, GET_HEAP_MARKING_BITS, is_incremental_marking, MARK_IN_BITMAP, rb_objspace::mark_stack, obj_info(), push_mark_stack(), rb_bug(), RVALUE_MARKED(), RVALUE_MARKING(), and TRUE.
Referenced by gc_mark_from(), gc_mark_ptr(), gc_writebarrier_incremental(), rb_gc_writebarrier_remember(), and rgengc_check_relation().
|
static |
Definition at line 3530 of file gc.c.
References FALSE, rb_heap_struct::free_pages, heap_increment(), heap_set_increment(), and rb_memerror().
Referenced by gc_sweep().
|
static |
Definition at line 6710 of file gc.c.
References gc_mode, gc_mode_marking, gc_mode_none, GPR_FLAG_CAPI, GPR_FLAG_HAVE_FINALIZE, GPR_FLAG_IMMEDIATE_SWEEP, GPR_FLAG_MAJOR_BY_FORCE, GPR_FLAG_MAJOR_BY_NOFREE, GPR_FLAG_MAJOR_BY_OLDGEN, GPR_FLAG_MAJOR_BY_OLDMALLOC, GPR_FLAG_MAJOR_BY_SHADY, GPR_FLAG_MALLOC, GPR_FLAG_METHOD, GPR_FLAG_NEWOBJ, GPR_FLAG_STRESS, hash(), objspace_and_reason::immediate_sweep, rb_objspace::latest_gc_info, malloc, NIL_P, PRIsVALUE, rb_objspace::profile, Qfalse, Qnil, Qtrue, rb_eArgError, rb_eTypeError, rb_raise(), rb_sym2str, RB_TYPE_P, S, SET, SYMBOL_P, and T_HASH.
Referenced by gc_latest_gc_info(), gc_profile_record_get(), and rb_gc_latest_gc_info().
Definition at line 6819 of file gc.c.
References gc_info_decode(), Qnil, rb_eTypeError, rb_hash_new(), rb_objspace, rb_raise(), rb_scan_args(), RB_TYPE_P, SYMBOL_P, and T_HASH.
Referenced by Init_GC().
|
inlinestatic |
Definition at line 4387 of file gc.c.
References gc_mark_ptr(), and is_markable_object().
Referenced by gc_mark_children(), gc_mark_imemo(), gc_mark_roots(), gc_mark_values(), mark_const_entry_i(), mark_entry(), mark_key(), mark_keyvalue(), mark_method_entry(), mark_method_entry_i(), and rb_gc_mark().
|
static |
Definition at line 4472 of file gc.c.
References RVALUE::array, RVALUE::as, RString::as, RArray::as, RVALUE::basic, BUILTIN_TYPE, RVALUE::complex, RVALUE::data, DATA_PTR, RRational::den, RData::dmark, rb_data_type_struct::dmark, rb_io_t::rb_io_enc_t::ecopts, ELTS_SHARED, rb_io_t::encs, RVALUE::file, FL_EXIVAR, FL_TEST, RFile::fptr, rb_data_type_struct::function, gc_mark(), gc_mark_imemo(), gc_mark_set_parent(), RVALUE::hash, RString::heap, RArray::heap, RHash::ifnone, RComplex::imag, is_pointer_to_heap(), RBasic::klass, len, mark_const_tbl(), mark_hash(), mark_m_tbl(), mark_tbl(), RVALUE::match, RVALUE::node, RHash::ntbl, RRational::num, rb_io_t::pathv, RANY, RARRAY_CONST_PTR, RARRAY_LEN, RVALUE::rational, rb_bug(), rb_gc_mark_node(), rb_gcdebug_print_obj_condition(), rb_mark_generic_ivar(), RCLASS_CALLABLE_M_TBL, RCLASS_CONST_TBL, RCLASS_EXT, RCLASS_IV_TBL, RCLASS_M_TBL, RCLASS_SUPER, RComplex::real, RMatch::regexp, RVALUE::regexp, RICLASS_IS_ORIGIN, ROBJECT_IVPTR, ROBJECT_NUMIV, RSTRUCT_CONST_PTR, RSTRUCT_LEN, RTYPEDDATA_P, RRegexp::src, RMatch::str, STR_SHARED_P, RVALUE::string, T_ARRAY, T_BIGNUM, T_CLASS, T_COMPLEX, T_DATA, T_FILE, T_FIXNUM, T_FLOAT, T_HASH, T_ICLASS, T_IMEMO, T_MATCH, T_MODULE, T_NIL, T_NODE, T_NONE, T_OBJECT, T_RATIONAL, T_REGEXP, T_STRING, T_STRUCT, T_SYMBOL, T_ZOMBIE, rb_io_t::tied_io_for_writing, RTypedData::type, RVALUE::typeddata, rb_io_t::write_lock, rb_io_t::writeconv_asciicompat, and rb_io_t::writeconv_pre_ecopts.
Referenced by gc_mark_stacked_objects(), gc_marks_wb_unprotected_objects(), rb_objspace_reachable_objects_from(), and rgengc_rememberset_mark().
|
static |
Definition at line 5866 of file gc.c.
References FALSE, gc_aging(), gc_grey(), gc_mark_set(), gc_mark_set_parent(), gc_writebarrier_incremental(), NOINLINE(), and rgengc_check_relation().
Referenced by gc_writebarrier_incremental().
|
static |
Definition at line 4423 of file gc.c.
References env, rb_env_t::env, rb_env_t::env_size, rb_env_t::ep, gc_mark(), gc_mark_maybe(), gc_mark_values(), imemo_cref, imemo_env, imemo_ifunc, imemo_iseq, imemo_memo, imemo_ment, imemo_svar, imemo_throw_data, rb_env_t::iseq, mark_method_entry(), RANY, rb_iseq_mark(), rb_vm_env_prev_env(), VM_ASSERT, VM_ENV_ESCAPED_P(), VM_ENV_FLAG_WB_REQUIRED, VM_ENV_FLAGS_SET(), and VM_UNREACHABLE.
Referenced by gc_mark_children().
|
static |
Definition at line 3998 of file gc.c.
References mark_locations_array(), and heap_page::start.
Referenced by mark_stack_locations(), and rb_gc_mark_locations().
|
static |
Definition at line 4235 of file gc.c.
References BUILTIN_TYPE, gc_mark_ptr(), is_pointer_to_heap(), T_NONE, T_ZOMBIE, and VALGRIND_MAKE_MEM_DEFINED.
Referenced by gc_mark_imemo(), mark_locations_array(), and rb_gc_mark_maybe().
|
static |
Definition at line 4373 of file gc.c.
References rb_objspace::mark_func_data_struct::data, gc_aging(), gc_grey(), gc_mark_set(), LIKELY, rb_objspace::mark_func_data_struct::mark_func, rb_objspace::mark_func_data, NULL, and rgengc_check_relation().
Referenced by gc_aging(), gc_mark(), and gc_mark_maybe().
|
static |
Definition at line 4711 of file gc.c.
References ALLOC_N, ANYARGS, dont_gc, finalizer_table, free_stack_chunks(), gc_mark(), GET_HEAP_MARK_BITS, GET_THREAD, global_list, rb_objspace::increase, init_mark_stack(), key, list, rb_objspace::malloc_params, MARK_CHECKPOINT, mark_current_machine_context(), rb_objspace::mark_func_data, mark_tbl(), MARKED_IN_BITMAP, gc_list::next, obj_info(), rb_objspace::oldmalloc_increase, rb_objspace::parent_object, POP_MARK_FUNC_DATA, pop_mark_stack(), PUSH_MARK_FUNC_DATA, push_mark_stack(), Qfalse, rb_bug(), rb_gc_disable(), rb_gc_enable(), rb_gc_mark(), rb_gc_mark_encodings(), rb_gc_mark_global_tbl(), rb_gc_mark_maybe(), rb_mark_end_proc(), rb_objspace_reachable_objects_from(), rb_vm_mark(), rb_objspace::rgengc, rb_vm_struct::self, SET_STACK_END, size, SIZED_REALLOC_N, ST_CONTINUE, st_data_t, st_foreach, st_free_table, st_init_numtable, st_insert, st_lookup, stress_to_class, strlen(), TRUE, gc_list::varptr, rb_thread_struct::vm, xfree(), and xmalloc.
Referenced by gc_marks_finish(), gc_marks_start(), and rb_objspace_reachable_objects_from_root().
|
inlinestatic |
Definition at line 4253 of file gc.c.
References GET_HEAP_MARK_BITS, MARK_IN_BITMAP, and RVALUE_MARKED().
Referenced by gc_mark_from(), gc_mark_ptr(), newobj_init(), and rb_gc_writebarrier_unprotect().
|
inlinestatic |
Definition at line 4410 of file gc.c.
References rb_objspace::parent_object, Qfalse, rb_objspace::rgengc, and RVALUE_OLD_P().
Referenced by gc_mark_children(), and gc_mark_from().
|
inlinestatic |
incremental: 0 -> not incremental (do all) incremental: n -> mark at most `n' objects
Definition at line 4629 of file gc.c.
References CLEAR_IN_BITMAP, FALSE, gc_mark_children(), gc_verify_internal_consistency(), GET_HEAP_MARKING_BITS, is_mark_stack_empty(), rb_objspace::mark_stack, rb_objspace::marked_slots, obj_info(), pop_mark_stack(), Qnil, Qundef, rb_bug(), RGENGC_CHECK_MODE, RVALUE_MARKED(), RVALUE_MARKING(), shrink_stack_chunk_cache(), and TRUE.
Referenced by gc_mark_stacked_objects_all(), and gc_mark_stacked_objects_incremental().
|
static |
Definition at line 4682 of file gc.c.
References FALSE, and gc_mark_stacked_objects().
Referenced by gc_marks_rest(), and gc_marks_wb_unprotected_objects().
|
static |
Definition at line 4676 of file gc.c.
References gc_mark_stacked_objects(), and TRUE.
Referenced by gc_marks_rest(), and gc_marks_step().
|
static |
Definition at line 4014 of file gc.c.
References gc_mark().
Referenced by gc_mark_imemo(), and rb_gc_mark_values().
|
static |
Definition at line 5610 of file gc.c.
References gc_marks_rest(), gc_marks_start(), gc_prof_mark_timer_start(), gc_prof_mark_timer_stop(), gc_prof_record, is_incremental_marking, NULL, rb_objspace::old_objects, POP_MARK_FUNC_DATA, PUSH_MARK_FUNC_DATA, rb_objspace::rgengc, and TRUE.
Referenced by gc_start().
|
static |
Definition at line 5571 of file gc.c.
References assert, dont_gc, FALSE, rb_heap_struct::free_pages, heap_page::free_slots, gc_enter(), gc_exit(), gc_marks_rest(), gc_marks_step(), gc_report, heap_increment(), heap_move_pooled_pages_to_free_pages(), HEAP_PAGE_OBJ_LIMIT, rb_objspace::mark_stack, mark_stack_size(), NULL, rb_heap_struct::pooled_pages, POP_MARK_FUNC_DATA, PUSH_MARK_FUNC_DATA, RGENGC_CHECK_MODE, rb_objspace::rincgc, and rb_objspace::step_slots.
Referenced by heap_prepare().
|
static |
Definition at line 5398 of file gc.c.
References assert, rb_objspace::count, rb_objspace::during_incremental_marking, FALSE, rb_objspace::flags, gc_event_hook, gc_mark_roots(), gc_marks_wb_unprotected_objects(), gc_report, gc_verify_heap_pages(), gc_verify_internal_consistency(), GPR_FLAG_MAJOR_BY_FORCE, GPR_FLAG_MAJOR_BY_NOFREE, GPR_FLAG_MAJOR_BY_OLDGEN, GPR_FLAG_MAJOR_BY_SHADY, heap_allocatable_pages, heap_eden, heap_extend_pages(), ruby_gc_params_t::heap_free_slots, ruby_gc_params_t::heap_free_slots_max_ratio, ruby_gc_params_t::heap_free_slots_min_ratio, heap_increment(), ruby_gc_params_t::heap_init_slots, heap_move_pooled_pages_to_free_pages(), HEAP_PAGE_OBJ_LIMIT, heap_pages_freeable_pages, heap_set_increment(), is_full_marking, is_incremental_marking, is_mark_stack_empty(), rb_objspace::last_major_gc, rb_objspace::mark_stack, mark_stack_size(), rb_objspace::marked_slots, rb_objspace::need_major_gc, rb_objspace::old_objects, rb_objspace::old_objects_limit, ruby_gc_params_t::oldobject_limit_factor, rb_objspace::profile, Qnil, rb_bug(), rb_objspace::rgengc, RGENGC_CHECK_MODE, RGENGC_FORCE_MAJOR_GC, RUBY_INTERNAL_EVENT_GC_END_MARK, RVALUE_OLD_AGE, rb_heap_struct::total_slots, heap_page::total_slots, TRUE, rb_objspace::uncollectible_wb_unprotected_objects, and rb_objspace::uncollectible_wb_unprotected_objects_limit.
Referenced by gc_marks_rest(), and gc_marks_step().
|
static |
Definition at line 5547 of file gc.c.
References FALSE, gc_mark_stacked_objects_all(), gc_mark_stacked_objects_incremental(), gc_marks_finish(), gc_report, gc_sweep(), heap_eden, is_incremental_marking, and NULL.
Referenced by gc_marks(), gc_marks_continue(), and gc_rest().
|
static |
Definition at line 5306 of file gc.c.
References rb_objspace::count, rb_objspace::during_minor_gc, FALSE, rb_objspace::flags, gc_mark_roots(), gc_mode_marking, gc_mode_transition(), gc_report, heap_eden, HEAP_PAGE_OBJ_LIMIT, rb_objspace::last_major_gc, rb_objspace::major_gc_count, rb_objspace::mark_stack, mark_stack_size(), rb_objspace::marked_slots, rb_objspace::minor_gc_count, NULL, rb_objspace::old_objects, rb_objspace::pooled_slots, rb_objspace::profile, rb_objspace::rgengc, rgengc_mark_and_rememberset_clear(), rgengc_rememberset_mark(), rb_objspace::rincgc, rb_objspace::step_slots, TRUE, and rb_objspace::uncollectible_wb_unprotected_objects.
Referenced by gc_marks().
|
static |
Definition at line 5532 of file gc.c.
References assert, gc_mark_stacked_objects_incremental(), gc_marks_finish(), gc_sweep(), is_marking, rb_objspace::marked_slots, and RGENGC_CHECK_MODE.
Referenced by gc_marks_continue().
|
static |
Definition at line 5344 of file gc.c.
References assert, BITS_BITLENGTH, gc_mark_children(), gc_mark_stacked_objects_all(), gc_report, heap_eden, HEAP_PAGE_BITMAP_LIMIT, heap_page::mark_bits, heap_page::next, NUM_IN_PAGE, obj_info(), RGENGC_CHECK_MODE, RVALUE_MARKED(), RVALUE_WB_UNPROTECTED(), heap_page::start, and heap_page::wb_unprotected_bits.
Referenced by gc_marks_finish().
Definition at line 3542 of file gc.c.
References gc_mode_marking, gc_mode_none, gc_mode_sweeping, and rb_bug().
Referenced by gc_mode_transition().
|
static |
Definition at line 3553 of file gc.c.
References assert, gc_mode, gc_mode_marking, gc_mode_name(), gc_mode_none, gc_mode_set, and gc_mode_sweeping.
Referenced by gc_marks_start(), gc_sweep_finish(), and gc_sweep_start().
Definition at line 750 of file gc.c.
References gc_mode_marking, gc_mode_none, gc_mode_sweeping, and rb_bug().
|
inlinestatic |
Definition at line 3436 of file gc.c.
References heap_page::before_sweep, BITMAP_BIT, BITMAP_INDEX, BITS_BITLENGTH, BUILTIN_TYPE, FALSE, heap_page::final_slots, finalizing, heap_page::flags, heap_page::free_slots, gc_finalize_deferred_register(), gc_prof_enabled, gc_prof_record, gc_report, gc_setup_mark_bits(), GET_THREAD, heap_page_add_freeobj(), HEAP_PAGE_BITMAP_LIMIT, heap_pages_deferred_final, heap_pages_final_slots, is_full_marking, heap_page::mark_bits, NUM_IN_PAGE, obj_free(), obj_info(), rb_objspace::profile, rb_bug(), rb_gc_count(), rgengc_remembered(), RVALUE_OLD_P(), heap_page::start, T_NONE, T_ZOMBIE, rb_objspace::total_freed_objects, heap_page::total_slots, and VALGRIND_MAKE_MEM_UNDEFINED.
Referenced by gc_sweep_step().
|
inlinestatic |
Definition at line 8668 of file gc.c.
References gc_prof_enabled, gc_prof_record, getrusage_time(), and RUBY_DTRACE_GC_HOOK.
Referenced by gc_marks().
|
inlinestatic |
Definition at line 8679 of file gc.c.
References elapsed_time_from(), gc_prof_enabled, gc_prof_record, and RUBY_DTRACE_GC_HOOK.
Referenced by gc_marks().
|
inlinestatic |
Definition at line 8742 of file gc.c.
References gc_prof_enabled, gc_prof_record, HEAP_PAGE_OBJ_LIMIT, gc_profile_record::heap_total_objects, gc_profile_record::heap_total_size, gc_profile_record::heap_use_size, rb_objspace::heap_used_at_gc_start, rb_objspace::profile, rb_objspace::total_allocated_objects_at_gc_start, and rb_objspace::total_freed_objects.
Referenced by gc_sweep_finish().
|
inlinestatic |
Definition at line 8730 of file gc.c.
References gc_prof_enabled, gc_prof_record, malloc_increase, and malloc_limit.
Referenced by gc_reset_malloc_info().
|
inlinestatic |
Definition at line 8584 of file gc.c.
References rb_objspace::current_record, gc_profile_record::flags, GC_PROFILE_RECORD_DEFAULT_SIZE, getrusage(), GPR_FLAG_STRESS, malloc, malloc_allocated_size, MEMZERO, rb_objspace::next_index, rb_objspace::profile, rb_bug(), rb_memerror(), realloc, rb_objspace::records, ruby_gc_stressful, rb_objspace::run, and rb_objspace::size.
Referenced by gc_start().
|
inlinestatic |
Definition at line 8691 of file gc.c.
References gc_prof_enabled, gc_prof_record, GC_PROFILE_MORE_DETAIL, rb_objspace::gc_sweep_start_time, gc_profile_record::gc_time, getrusage_time(), rb_objspace::profile, and RUBY_DTRACE_GC_HOOK.
Referenced by gc_sweep(), and gc_sweep_step().
|
inlinestatic |
Definition at line 8704 of file gc.c.
References elapsed_time_from(), gc_profile_record::flags, gc_prof_enabled, gc_prof_record, GC_PROFILE_MORE_DETAIL, rb_objspace::gc_sweep_start_time, gc_profile_record::gc_time, GPR_FLAG_HAVE_FINALIZE, heap_pages_deferred_final, rb_objspace::latest_gc_info, rb_objspace::profile, and RUBY_DTRACE_GC_HOOK.
Referenced by gc_sweep(), and gc_sweep_step().
|
inlinestatic |
Definition at line 8631 of file gc.c.
References gc_profile_record::gc_invoke_time, gc_prof_enabled, gc_prof_record, gc_profile_record::gc_time, getrusage_time(), and rb_objspace::profile.
Referenced by gc_start().
|
inlinestatic |
Definition at line 8656 of file gc.c.
References elapsed_time_from(), gc_profile_record::gc_invoke_time, gc_prof_enabled, gc_prof_record, gc_profile_record::gc_time, rb_objspace::invoke_time, and rb_objspace::profile.
Referenced by gc_start().
|
static |
Definition at line 8770 of file gc.c.
References rb_objspace::current_record, GC_PROFILE_RECORD_DEFAULT_SIZE, MEMZERO, rb_objspace::next_index, rb_objspace::profile, Qnil, rb_memerror(), rb_objspace, realloc, rb_objspace::records, and rb_objspace::size.
Referenced by Init_GC().
|
static |
Definition at line 9120 of file gc.c.
References rb_objspace::current_record, FALSE, rb_objspace::profile, Qnil, rb_objspace, and rb_objspace::run.
Referenced by Init_GC().
Definition at line 8918 of file gc.c.
References CALC_EXACT_MALLOC_SIZE, code_page_table::count, rb_objspace::count, gc_profile_record::flags, gc_profile_record::gc_invoke_time, GC_PROFILE_DETAIL_MEMORY, gc_profile_record::gc_time, GPR_FLAG_CAPI, GPR_FLAG_HAVE_FINALIZE, GPR_FLAG_MALLOC, GPR_FLAG_METHOD, GPR_FLAG_NEWOBJ, GPR_FLAG_STRESS, gc_profile_record::heap_total_objects, gc_profile_record::heap_total_size, gc_profile_record::heap_use_size, rb_objspace::next_index, PRIuSIZE, rb_objspace::profile, rb_objspace, rb_sprintf(), rb_str_new_cstr(), rb_objspace::records, RGENGC_PROFILE, and rb_objspace::run.
Referenced by gc_profile_report(), and gc_profile_result().
|
static |
Definition at line 9103 of file gc.c.
References rb_objspace::current_record, rb_objspace::profile, Qnil, rb_objspace, rb_objspace::run, and TRUE.
Referenced by Init_GC().
Definition at line 9088 of file gc.c.
References rb_objspace::profile, Qfalse, Qtrue, rb_objspace, and rb_objspace::run.
Referenced by Init_GC().
|
static |
Definition at line 8837 of file gc.c.
References C, DBL2NUM, gc_profile_record::flags, gc_info_decode(), gc_profile_record::gc_invoke_time, gc_profile_record::gc_time, GPR_FLAG_HAVE_FINALIZE, GPR_FLAG_MAJOR_MASK, GPR_FLAG_NONE, gc_profile_record::heap_total_objects, gc_profile_record::heap_total_size, gc_profile_record::heap_use_size, ID2SYM, M, N, rb_objspace::next_index, O, rb_objspace::profile, Qfalse, Qnil, Qtrue, rb_ary_new(), rb_ary_push(), rb_hash_aset(), rb_hash_new(), rb_intern, rb_objspace, rb_objspace::records, rb_objspace::run, S, and SIZET2NUM.
Referenced by Init_GC().
Definition at line 9041 of file gc.c.
References gc_profile_dump_on(), Qnil, rb_io_write(), rb_scan_args(), and rb_stdout.
Referenced by Init_GC().
|
static |
Definition at line 9024 of file gc.c.
References gc_profile_dump_on(), rb_str_buf_append(), and rb_str_buf_new().
Referenced by Init_GC().
Definition at line 9064 of file gc.c.
References code_page_table::count, DBL2NUM, gc_profile_record::gc_time, rb_objspace::next_index, rb_objspace::profile, rb_objspace, rb_objspace::records, and rb_objspace::run.
Referenced by Init_GC().
|
inlinestatic |
Definition at line 6518 of file gc.c.
Referenced by gc_current_status(), gc_enter(), and gc_exit().
|
static |
Definition at line 4262 of file gc.c.
References BUILTIN_TYPE, FALSE, heap_page::flags, GET_HEAP_PAGE, heap_page::has_uncollectible_shady_objects, MARK_IN_BITMAP, MARKED_IN_BITMAP, rb_objspace::profile, rb_objspace::rgengc, TRUE, heap_page::uncollectible_bits, and rb_objspace::uncollectible_wb_unprotected_objects.
Referenced by gc_writebarrier_generational(), gc_writebarrier_incremental(), rb_gc_writebarrier_unprotect(), and rgengc_check_relation().
|
static |
Definition at line 5643 of file gc.c.
References buf, during_gc, heap_eden, is_full_marking, is_incremental_marking, is_lazy_sweeping, RGENGC_DEBUG, and vsnprintf.
|
static |
Definition at line 6244 of file gc.c.
References ATOMIC_SIZE_EXCHANGE, gc_prof_set_malloc_info(), GPR_FLAG_MAJOR_BY_OLDMALLOC, is_full_marking, rb_objspace::latest_gc_info, malloc_increase, malloc_limit, ruby_gc_params_t::malloc_limit_growth_factor, ruby_gc_params_t::malloc_limit_max, ruby_gc_params_t::malloc_limit_min, rb_objspace::need_major_gc, rb_objspace::oldmalloc_increase, rb_objspace::oldmalloc_increase_limit, ruby_gc_params_t::oldmalloc_limit_growth_factor, ruby_gc_params_t::oldmalloc_limit_max, ruby_gc_params_t::oldmalloc_limit_min, PRIuSIZE, rb_objspace::profile, rb_gc_count(), and rb_objspace::rgengc.
Referenced by gc_start().
|
static |
Definition at line 6416 of file gc.c.
References gc_enter(), gc_exit(), gc_marks_rest(), gc_sweep_rest(), gc_verify_internal_consistency(), heap_eden, is_incremental_marking, is_lazy_sweeping, NULL, POP_MARK_FUNC_DATA, PUSH_MARK_FUNC_DATA, Qnil, and RGENGC_CHECK_MODE.
Referenced by garbage_collect(), objspace_malloc_increase(), rb_gc_disable(), rb_objspace_call_finalizer(), and rb_objspace_each_objects().
|
static |
Definition at line 7421 of file gc.c.
References heap_add_pages(), heap_eden, ruby_gc_params_t::heap_init_slots, HEAP_PAGE_OBJ_LIMIT, and rb_objspace.
Referenced by ruby_gc_set_params().
|
static |
Definition at line 3424 of file gc.c.
References HEAP_PAGE_BITMAP_SIZE, heap_page::mark_bits, memcpy, and heap_page::uncollectible_bits.
Referenced by gc_page_sweep().
|
static |
Definition at line 6329 of file gc.c.
References assert, rb_objspace::count, rb_objspace::dont_incremental, during_gc, rb_objspace::during_incremental_marking, FALSE, FIX2INT, FIXNUM_P, rb_objspace::flags, GC_ENABLE_INCREMENTAL_MARK, GC_ENABLE_LAZY_SWEEP, gc_enter(), gc_event_hook, gc_exit(), gc_marks(), gc_mode, gc_mode_none, gc_prof_setup_new_record(), gc_prof_timer_start(), gc_prof_timer_stop(), gc_report, gc_reset_malloc_info(), gc_stress_no_immediate_sweep, gc_stress_no_major, gc_verify_internal_consistency(), GPR_FLAG_IMMEDIATE_SWEEP, GPR_FLAG_MAJOR_BY_FORCE, GPR_FLAG_MAJOR_MASK, GPR_FLAG_METHOD, GPR_FLAG_NONE, heap_allocated_pages, heap_eden, rb_objspace::heap_used_at_gc_start, rb_objspace::immediate_sweep, is_incremental_marking, is_lazy_sweeping, rb_objspace::latest_gc_info, rb_objspace::need_major_gc, rb_objspace::profile, Qnil, ready_to_gc(), rb_objspace::rgengc, RGENGC_CHECK_MODE, RGENGC_FORCE_MAJOR_GC, ruby_gc_stress_mode, ruby_gc_stressful, RUBY_INTERNAL_EVENT_GC_START, rb_objspace::total_allocated_objects, rb_objspace::total_allocated_objects_at_gc_start, and TRUE.
Referenced by garbage_collect(), and heap_prepare().
Definition at line 6617 of file gc.c.
References objspace_and_reason::full_mark, garbage_collect(), gc_finalize_deferred(), GPR_FLAG_METHOD, objspace_and_reason::immediate_mark, objspace_and_reason::immediate_sweep, NIL_P, Qnil, Qundef, rb_get_kwargs(), rb_intern, rb_objspace, rb_scan_args(), RTEST, and TRUE.
Referenced by Init_GC().
Definition at line 7195 of file gc.c.
References gc_stat_internal(), Qnil, rb_eTypeError, rb_hash_new(), rb_raise(), rb_scan_args(), RB_TYPE_P, SIZET2NUM, SYMBOL_P, and T_HASH.
Referenced by Init_GC().
|
static |
Definition at line 7051 of file gc.c.
References compat_key(), code_page_table::count, rb_objspace::count, default_proc_for_compat_func(), heap_allocatable_pages, heap_allocated_pages, heap_eden, heap_pages_final_slots, heap_pages_sorted_length, heap_tomb, rb_objspace::major_gc_count, malloc_increase, malloc_limit, rb_objspace::marked_slots, rb_objspace::minor_gc_count, NIL_P, objspace_available_slots(), objspace_free_slots(), objspace_live_slots(), rb_objspace::old_objects, rb_objspace::old_objects_limit, rb_objspace::oldmalloc_increase, rb_objspace::oldmalloc_increase_limit, PRIsVALUE, rb_objspace::profile, Qnil, rb_eArgError, rb_eTypeError, rb_gc_register_mark_object(), rb_hash_set_default_proc(), rb_objspace, rb_proc_new(), rb_raise(), rb_sym2str, RB_TYPE_P, rb_objspace::rgengc, RHASH_IFNONE, SET, setup_gc_stat_symbols(), SYMBOL_P, T_HASH, rb_objspace::total_allocated_objects, rb_objspace::total_allocated_pages, rb_objspace::total_freed_objects, rb_objspace::total_freed_pages, rb_objspace::uncollectible_wb_unprotected_objects, and rb_objspace::uncollectible_wb_unprotected_objects_limit.
Referenced by gc_stat(), and rb_gc_stat().
Definition at line 7237 of file gc.c.
References rb_objspace, and ruby_gc_stress_mode.
Referenced by Init_GC().
|
static |
Definition at line 7244 of file gc.c.
References rb_objspace::flags, rb_objspace::gc_stress_mode, rb_objspace::gc_stressful, and RTEST.
Referenced by gc_stress_set_m(), and Init_heap().
Definition at line 7268 of file gc.c.
References gc_stress_set(), and rb_objspace.
Referenced by Init_GC().
|
static |
Definition at line 3712 of file gc.c.
References heap_page::before_sweep, rb_objspace::flags, heap_page::flags, gc_heap_prepare_minimum_pages(), gc_prof_sweep_timer_start(), gc_prof_sweep_timer_stop(), gc_report, gc_sweep_rest(), gc_sweep_start(), gc_sweep_step(), heap_eden, rb_objspace::immediate_sweep, heap_page::next, and TRUE.
Referenced by gc_marks_rest(), and gc_marks_step().
|
static |
Definition at line 3696 of file gc.c.
References assert, dont_gc, FALSE, gc_enter(), gc_exit(), gc_report, gc_sweep_step(), GPR_FLAG_NONE, heap_increment(), rb_objspace::need_major_gc, rb_objspace::rgengc, and RGENGC_CHECK_MODE.
Referenced by heap_prepare().
|
static |
Definition at line 3598 of file gc.c.
References gc_event_hook, gc_mode_none, gc_mode_transition(), gc_prof_set_heap_info(), gc_report, gc_verify_internal_consistency(), heap_allocatable_pages, heap_pages_free_unused_pages(), heap_tomb, Qnil, and RUBY_INTERNAL_EVENT_GC_END_SWEEP.
Referenced by gc_sweep_step().
|
static |
Definition at line 3685 of file gc.c.
References gc_sweep_step(), has_sweeping_pages, and heap_eden.
Referenced by gc_rest(), and gc_sweep().
|
static |
Definition at line 3591 of file gc.c.
References gc_mode_sweeping, gc_mode_transition(), gc_sweep_start_heap(), and heap_eden.
Referenced by gc_sweep().
|
static |
Definition at line 3568 of file gc.c.
References RVALUE::as, RVALUE::free, rb_heap_struct::free_pages, rb_heap_struct::freelist, heap_page::freelist, NULL, rb_heap_struct::pages, rb_heap_struct::pooled_pages, rb_objspace::pooled_slots, rb_objspace::rincgc, rb_heap_struct::sweep_pages, and rb_heap_struct::using_page.
Referenced by gc_sweep_start().
|
static |
Definition at line 3619 of file gc.c.
References FALSE, heap_page::final_slots, heap_page::free_next, rb_heap_struct::free_pages, heap_page::free_slots, gc_page_sweep(), gc_prof_sweep_timer_start(), gc_prof_sweep_timer_stop(), gc_report, gc_sweep_finish(), heap_add_freepage(), heap_add_page(), heap_add_poolpage(), heap_pages_freeable_pages, heap_tomb, heap_unlink_page(), heap_page::next, NULL, rb_heap_struct::sweep_pages, heap_page::total_slots, TRUE, and will_be_incremental_marking.
Referenced by gc_sweep(), gc_sweep_continue(), and gc_sweep_rest().
|
static |
Definition at line 5130 of file gc.c.
References BUILTIN_TYPE, FALSE, heap_page::final_slots, heap_page::flags, heap_page::free_slots, heap_page::has_remembered_objects, heap_page::has_uncollectible_shady_objects, if(), is_incremental_marking, obj_info(), rb_bug(), RBASIC, RVALUE_PAGE_MARKING, RVALUE_PAGE_UNCOLLECTIBLE, RVALUE_PAGE_WB_UNPROTECTED, heap_page::start, T_ZOMBIE, heap_page::total_slots, and TRUE.
Referenced by gc_verify_heap_pages_().
|
static |
Definition at line 5201 of file gc.c.
References gc_verify_heap_pages_(), heap_eden, and heap_tomb.
Referenced by gc_marks_finish(), and gc_verify_internal_consistency().
|
static |
Definition at line 5186 of file gc.c.
References FALSE, heap_page::flags, gc_verify_heap_page(), heap_page::has_remembered_objects, heap_page::next, and Qfalse.
Referenced by gc_verify_heap_pages().
Definition at line 5220 of file gc.c.
References each_obj_args::callback, each_obj_args::data, verify_internal_consistency_struct::err_count, finalizing, gc_report, gc_verify_heap_pages(), heap_eden, heap_pages_deferred_final, heap_pages_final_slots, is_lazy_sweeping, is_marking, verify_internal_consistency_struct::live_object_count, NULL, verify_internal_consistency_struct::objspace, objspace_each_objects(), objspace_live_slots(), verify_internal_consistency_struct::old_object_count, rb_objspace::old_objects, PRIuSIZE, rb_objspace::profile, Qnil, rb_bug(), rb_objspace, verify_internal_consistency_struct::remembered_shady_count, rb_objspace::rgengc, RZOMBIE, rb_objspace::total_freed_objects, rb_objspace::uncollectible_wb_unprotected_objects, verify_internal_consistency_i(), and verify_internal_consistency_struct::zombie_object_count.
Referenced by gc_enter(), gc_mark_stacked_objects(), gc_marks_finish(), gc_rest(), gc_start(), gc_sweep_finish(), Init_GC(), rb_gc_call_finalizer_at_exit(), and rb_gc_verify_internal_consistency().
|
static |
Definition at line 6548 of file gc.c.
References objspace_and_reason::full_mark, garbage_collect(), objspace_and_reason::immediate_mark, objspace_and_reason::immediate_sweep, objspace_and_reason::objspace, and objspace_and_reason::reason.
Referenced by garbage_collect_with_gvl().
|
static |
Definition at line 5832 of file gc.c.
References check_rvalue_consistency(), gc_remember_unprotected(), gc_report, GET_HEAP_MARK_BITS, is_incremental_marking, MARK_IN_BITMAP, obj_info(), rb_bug(), RGENGC_CHECK_MODE, rgengc_remember(), rgengc_remembered(), RVALUE_AGE_SET_OLD(), RVALUE_OLD_P(), and RVALUE_WB_UNPROTECTED().
Referenced by rb_gc_writebarrier(), and rgengc_mark_and_rememberset_clear().
|
static |
Definition at line 5878 of file gc.c.
References gc_grey(), gc_mark_from(), gc_remember_unprotected(), gc_report, obj_info(), RVALUE_AGE_SET_OLD(), RVALUE_BLACK_P(), RVALUE_OLD_P(), RVALUE_WB_UNPROTECTED(), and RVALUE_WHITE_P().
Referenced by gc_mark_from(), and rb_gc_writebarrier().
|
static |
Definition at line 7381 of file gc.c.
References getenv, NULL, RTEST, ruby_verbose, strtod, and val.
Referenced by ruby_gc_set_params().
|
static |
|
static |
Definition at line 8530 of file gc.c.
References clock_gettime(), getrusage(), L, memcpy, timespec::tv_nsec, timeval::tv_sec, timespec::tv_sec, and timeval::tv_usec.
Referenced by elapsed_time_from(), garbage_collect(), gc_prof_mark_timer_start(), gc_prof_sweep_timer_start(), gc_prof_timer_start(), and Init_heap().
|
inlinestatic |
Definition at line 1411 of file gc.c.
References heap_page::free_next, rb_heap_struct::free_pages, and heap_page::freelist.
Referenced by gc_sweep_step(), and heap_assign_page().
|
static |
Definition at line 1593 of file gc.c.
References heap_page::flags, heap_tomb, heap_page::in_tomb, heap_page::next, rb_heap_struct::pages, heap_page::prev, rb_heap_struct::total_pages, rb_heap_struct::total_slots, and heap_page::total_slots.
Referenced by gc_sweep_step(), and heap_assign_page().
|
static |
Definition at line 1612 of file gc.c.
References add, heap_allocatable_pages, heap_assign_page(), and heap_pages_expand_sorted().
Referenced by gc_set_initial_pages(), and Init_heap().
|
inlinestatic |
Definition at line 1421 of file gc.c.
References FALSE, heap_page::free_next, heap_page::free_slots, heap_page::freelist, rb_heap_struct::pooled_pages, rb_objspace::pooled_slots, rb_objspace::rincgc, and TRUE.
Referenced by gc_sweep_step().
|
static |
Definition at line 1604 of file gc.c.
References heap_add_freepage(), heap_add_page(), and heap_page_create().
Referenced by heap_add_pages(), and heap_increment().
|
static |
Definition at line 1625 of file gc.c.
References f, ruby_gc_params_t::growth_factor, ruby_gc_params_t::growth_max_slots, heap_allocatable_pages, heap_allocated_pages, ruby_gc_params_t::heap_free_slots_goal_ratio, HEAP_PAGE_OBJ_LIMIT, and PRIuSIZE.
Referenced by gc_marks_finish().
|
inlinestatic |
Definition at line 1744 of file gc.c.
References RVALUE::as, RVALUE::free, rb_heap_struct::freelist, heap_get_freeobj_from_next_freepage(), LIKELY, and NULL.
Referenced by newobj_slowpath().
|
static |
Definition at line 1714 of file gc.c.
References assert, heap_page::free_next, rb_heap_struct::free_pages, heap_page::free_slots, heap_page::freelist, heap_prepare(), NULL, RGENGC_CHECK_MODE, and rb_heap_struct::using_page.
Referenced by heap_get_freeobj().
|
inlinestatic |
Definition at line 1734 of file gc.c.
References RVALUE::as, RVALUE::free, rb_heap_struct::freelist, LIKELY, and NULL.
Referenced by newobj_of().
|
static |
Definition at line 1678 of file gc.c.
References FALSE, gc_report, heap_allocatable_pages, heap_assign_page(), heap_pages_sorted_length, rb_heap_struct::total_pages, and TRUE.
Referenced by gc_heap_prepare_minimum_pages(), gc_marks_continue(), gc_marks_finish(), gc_sweep_continue(), heap_prepare(), heap_ready_to_gc(), and setup_gc_stat_symbols().
|
inlinestatic |
Definition at line 2949 of file gc.c.
References heap_page::before_sweep, FALSE, heap_page::flags, GET_HEAP_PAGE, and TRUE.
Referenced by is_swept_object().
Definition at line 5383 of file gc.c.
References heap_page::free_next, rb_heap_struct::free_pages, and rb_heap_struct::pooled_pages.
Referenced by gc_marks_continue(), and gc_marks_finish().
|
inlinestatic |
Definition at line 1396 of file gc.c.
References RVALUE::as, RVALUE::free, heap_page::freelist, gc_report, is_pointer_to_heap(), rb_bug(), and RGENGC_CHECK_MODE.
Referenced by finalize_list(), gc_page_sweep(), heap_page_allocate(), and rb_gc_force_recycle().
|
static |
Definition at line 1481 of file gc.c.
References aligned_free(), aligned_malloc(), calloc, heap_page::free_slots, gc_report, heap_page_body::header, heap_allocated_pages, heap_page_add_freeobj(), HEAP_PAGE_ALIGN, HEAP_PAGE_OBJ_LIMIT, HEAP_PAGE_SIZE, heap_pages_expand_sorted_to(), heap_pages_himem, heap_pages_lomem, heap_pages_sorted, heap_pages_sorted_length, hi, lo, MEMMOVE, heap_page_header::page, PRIdSIZE, PRIuVALUE, rb_objspace::profile, rb_bug(), rb_memerror(), heap_page::start, rb_objspace::total_allocated_pages, and heap_page::total_slots.
Referenced by heap_page_create().
|
static |
Definition at line 1579 of file gc.c.
References heap_allocated_pages, heap_page_allocate(), heap_page_resurrect(), heap_pages_sorted_length, heap_tomb, and NULL.
Referenced by heap_assign_page().
|
static |
Definition at line 1448 of file gc.c.
References aligned_free(), free(), GET_PAGE_BODY, heap_allocated_pages, rb_objspace::profile, heap_page::start, and rb_objspace::total_freed_pages.
Referenced by heap_pages_free_unused_pages(), rb_objspace_alloc(), and rb_objspace_free().
|
static |
Definition at line 1563 of file gc.c.
References heap_page::freelist, heap_tomb, heap_unlink_page(), heap_page::next, and NULL.
Referenced by heap_page_create().
|
static |
Definition at line 1384 of file gc.c.
References heap_allocatable_pages, heap_eden, heap_pages_expand_sorted_to(), heap_pages_sorted_length, and heap_tomb.
Referenced by heap_add_pages(), and heap_set_increment().
|
static |
Definition at line 1361 of file gc.c.
References gc_report, heap_pages_sorted, heap_pages_sorted_length, malloc, rb_memerror(), realloc, and size.
Referenced by heap_page_allocate(), and heap_pages_expand_sorted().
|
static |
Definition at line 1457 of file gc.c.
References assert, heap_page::flags, heap_page::free_slots, heap_allocated_pages, heap_page_free(), heap_pages_sorted, heap_tomb, heap_unlink_page(), heap_page::in_tomb, RGENGC_CHECK_MODE, and heap_page::total_slots.
Referenced by gc_sweep_finish().
|
static |
Definition at line 1691 of file gc.c.
References assert, FALSE, rb_heap_struct::free_pages, gc_marks_continue(), gc_start(), gc_sweep_continue(), GPR_FLAG_NEWOBJ, heap_increment(), is_incremental_marking, is_lazy_sweeping, NULL, rb_memerror(), RGENGC_CHECK_MODE, and will_be_incremental_marking.
Referenced by heap_get_freeobj_from_next_freepage().
|
static |
Definition at line 6221 of file gc.c.
References rb_heap_struct::free_pages, rb_heap_struct::freelist, heap_increment(), and heap_set_increment().
Referenced by ready_to_gc().
|
static |
Definition at line 1664 of file gc.c.
References gc_report, heap_allocatable_pages, heap_allocated_pages, heap_eden, and heap_pages_expand_sorted().
Referenced by gc_heap_prepare_minimum_pages(), gc_marks_finish(), and heap_ready_to_gc().
|
static |
Definition at line 1436 of file gc.c.
References heap_page::next, NULL, rb_heap_struct::pages, heap_page::prev, rb_heap_struct::total_pages, rb_heap_struct::total_slots, and heap_page::total_slots.
Referenced by gc_sweep_step(), heap_page_resurrect(), and heap_pages_free_unused_pages().
Definition at line 3034 of file gc.c.
References FIXNUM_P, FLONUM_P, ID2SYM, is_id_value(), is_live_object(), NUM2PTR, obj_id_to_ref, Qfalse, Qnil, Qtrue, rb_eRangeError, rb_id2str, rb_objspace, rb_raise(), and RBASIC.
Referenced by Init_GC().
|
static |
Definition at line 2386 of file gc.c.
References rb_objspace::dont_incremental, FALSE, rb_objspace::flags, Qnil, and rb_objspace.
Referenced by rb_objspace_each_objects().
void Init_GC | ( | void | ) |
Definition at line 9531 of file gc.c.
References CALC_EXACT_MALLOC_SIZE, count_objects(), define_final(), gc_count(), GC_DEBUG, GC_ENABLE_LAZY_SWEEP, gc_latest_gc_info(), gc_profile_clear(), GC_PROFILE_DETAIL_MEMORY, gc_profile_disable(), gc_profile_enable(), gc_profile_enable_get(), GC_PROFILE_MORE_DETAIL, gc_profile_record_get(), gc_profile_report(), gc_profile_result(), gc_profile_total_time(), gc_start_internal(), gc_stat(), gc_stress_get(), gc_stress_set_m(), gc_verify_internal_consistency(), HEAP_PAGE_BITMAP_PLANES, HEAP_PAGE_BITMAP_SIZE, HEAP_PAGE_OBJ_LIMIT, id2ref(), ID2SYM, MALLOC_ALLOCATED_SIZE, MALLOC_ALLOCATED_SIZE_CHECK, OBJ_FREEZE, OPT, os_each_obj(), rb_ary_new(), rb_cBasicObject, rb_cObject, rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), rb_define_method(), rb_define_module(), rb_define_module_function(), rb_define_module_under(), rb_define_private_method(), rb_define_singleton_method(), rb_eNoMemError, rb_gc_disable(), rb_gc_enable(), rb_hash_aset(), rb_hash_new(), rb_include_module(), rb_intern, rb_mEnumerable, rb_mKernel, rb_obj_id(), rb_vm_register_special_exception(), RGENGC_CHECK_MODE, RGENGC_DEBUG, RGENGC_ESTIMATE_OLDMALLOC, RGENGC_PROFILE, ruby_error_nomemory, SIZET2NUM, undefine_final(), USE_RGENGC, wmap_allocate(), wmap_aref(), wmap_aset(), wmap_each(), wmap_each_key(), wmap_each_value(), wmap_finalize(), wmap_has_key(), wmap_inspect(), wmap_keys(), wmap_size(), and wmap_values().
void Init_heap | ( | void | ) |
Definition at line 2323 of file gc.c.
References finalizer_table, free(), gc_stress_set(), GET_THREAD, getrusage_time(), heap_add_pages(), heap_eden, ruby_gc_params_t::heap_init_slots, HEAP_PAGE_OBJ_LIMIT, init_mark_stack(), rb_objspace::invoke_time, malloc, rb_objspace::mark_stack, rb_objspace::oldmalloc_increase_limit, ruby_gc_params_t::oldmalloc_limit_min, rb_objspace::profile, rb_objspace, rb_sigaltstack_size(), rb_objspace::rgengc, ruby_initial_gc_stress, and st_init_numtable.
Referenced by ruby_setup().
|
static |
Definition at line 3899 of file gc.c.
References add_stack_chunk_cache(), mark_stack::cache_size, mark_stack::index, mark_stack::limit, MEMZERO, stack_chunk_alloc(), STACK_CHUNK_SIZE, and mark_stack::unused_cache_size.
Referenced by gc_mark_roots(), and Init_heap().
void Init_stack | ( | volatile VALUE * | addr | ) |
Definition at line 6588 of file gc.c.
References ruby_init_stack().
|
static |
Definition at line 2467 of file gc.c.
References RVALUE::as, RVALUE::basic, BUILTIN_TYPE, FL_SINGLETON, FL_TEST, RBasic::flags, RBasic::klass, rb_singleton_class_internal_p(), T_CLASS, T_ICLASS, T_IMEMO, T_NODE, T_NONE, and T_ZOMBIE.
Referenced by os_obj_of_i(), rb_objspace_internal_object_p(), and rb_raw_obj_info().
|
static |
Definition at line 3884 of file gc.c.
References mark_stack::chunk, mark_stack::index, invalidate_mark_stack_chunk(), mark_stack::limit, stack_chunk::next, and rb_bug().
Referenced by rb_gc_force_recycle().
|
static |
Definition at line 3871 of file gc.c.
References stack_chunk::data, FALSE, Qundef, and TRUE.
Referenced by invalidate_mark_stack().
|
inlinestatic |
Definition at line 2968 of file gc.c.
References FALSE, GET_HEAP_MARK_BITS, heap_eden, is_lazy_sweeping, is_swept_object(), MARKED_IN_BITMAP, and TRUE.
Referenced by is_live_object(), and rb_objspace_garbage_object_p().
|
inlinestatic |
Definition at line 2940 of file gc.c.
References BUILTIN_TYPE, FALSE, is_pointer_to_heap(), T_FIXNUM, T_ICLASS, and TRUE.
Referenced by id2ref(), rb_objspace_call_finalizer(), wmap_aref(), wmap_each_i(), wmap_each_key_i(), wmap_each_value_i(), wmap_keys_i(), and wmap_values_i().
|
inlinestatic |
Definition at line 2982 of file gc.c.
References BUILTIN_TYPE, FALSE, is_garbage_object(), T_NONE, T_ZOMBIE, and TRUE.
Referenced by id2ref(), rb_objspace_markable_object_p(), verify_internal_consistency_i(), wmap_aref(), wmap_each_i(), wmap_each_key_i(), wmap_each_value_i(), wmap_keys_i(), and wmap_values_i().
|
inlinestatic |
Definition at line 3757 of file gc.c.
References mark_stack::chunk, and NULL.
Referenced by gc_mark_stacked_objects(), gc_marks_finish(), and pop_mark_stack().
|
inlinestatic |
Definition at line 2999 of file gc.c.
References check_rvalue_consistency(), FALSE, rb_special_const_p(), and TRUE.
Referenced by gc_mark(), rb_objspace_markable_object_p(), and rb_objspace_reachable_objects_from().
|
inlinestatic |
Definition at line 2054 of file gc.c.
References FALSE, heap_allocated_pages, heap_pages_himem, heap_pages_sorted, hi, lo, RANY, heap_page::start, heap_page::total_slots, and TRUE.
Referenced by check_rvalue_consistency(), gc_mark_children(), gc_mark_maybe(), heap_page_add_freeobj(), is_id_value(), rb_obj_info_dump(), and rb_objspace_data_type_name().
|
inlinestatic |
Definition at line 2956 of file gc.c.
References FALSE, heap_eden, heap_is_swept_object(), and TRUE.
Referenced by is_garbage_object(), and rb_obj_info_dump().
|
inlinestatic |
Definition at line 2109 of file gc.c.
References make_zombie(), RANY, and rb_io_fptr_finalize().
Referenced by obj_free(), and rb_objspace_call_finalizer().
|
inlinestatic |
Definition at line 2098 of file gc.c.
References RZombie::basic, RZombie::data, RZombie::dfree, RBasic::flags, heap_pages_deferred_final, RZombie::next, RZOMBIE, and T_ZOMBIE.
Referenced by make_io_zombie(), obj_free(), and rb_objspace_call_finalizer().
|
static |
Definition at line 4146 of file gc.c.
References rb_const_entry_struct::file, gc_mark(), ID_TABLE_CONTINUE, and rb_const_entry_struct::value.
Referenced by mark_const_tbl().
|
static |
Definition at line 4157 of file gc.c.
References mark_const_entry_i(), and rb_id_table_foreach_values().
Referenced by gc_mark_children().
|
static |
Definition at line 4177 of file gc.c.
References FLUSH_REGISTER_WINDOWS, GET_STACK_BOUNDS, mark_locations_array(), mark_stack_locations(), numberof, rb_jmp_buf, rb_setjmp, and SET_STACK_END.
Referenced by gc_mark_roots().
Definition at line 4031 of file gc.c.
References gc_mark(), and ST_CONTINUE.
Referenced by mark_tbl().
|
static |
Definition at line 4077 of file gc.c.
References mark_keyvalue(), st_data_t, and st_foreach.
Referenced by gc_mark_children(), and rb_mark_hash().
Definition at line 4046 of file gc.c.
References gc_mark(), and ST_CONTINUE.
Referenced by mark_set().
Definition at line 4067 of file gc.c.
References gc_mark(), and ST_CONTINUE.
Referenced by mark_hash().
|
static |
Definition at line 3987 of file gc.c.
References gc_mark_maybe().
Referenced by gc_mark_locations(), and mark_current_machine_context().
|
static |
Definition at line 4138 of file gc.c.
References mark_method_entry_i(), and rb_id_table_foreach_values().
Referenced by gc_mark_children().
|
static |
Definition at line 4090 of file gc.c.
References rb_method_definition_struct::alias, rb_method_definition_struct::attr, rb_method_definition_struct::body, rb_method_iseq_struct::cref, rb_method_entry_struct::def, rb_method_entry_struct::defined_class, gc_mark(), rb_method_definition_struct::iseq, rb_method_iseq_struct::iseqptr, rb_method_attr_struct::location, rb_method_refined_struct::orig_me, rb_method_alias_struct::original_me, rb_method_entry_struct::owner, rb_method_refined_struct::owner, rb_method_definition_struct::proc, rb_method_definition_struct::refined, rb_method_definition_struct::type, VM_METHOD_TYPE_ALIAS, VM_METHOD_TYPE_ATTRSET, VM_METHOD_TYPE_BMETHOD, VM_METHOD_TYPE_CFUNC, VM_METHOD_TYPE_ISEQ, VM_METHOD_TYPE_IVAR, VM_METHOD_TYPE_MISSING, VM_METHOD_TYPE_NOTIMPLEMENTED, VM_METHOD_TYPE_OPTIMIZED, VM_METHOD_TYPE_REFINED, VM_METHOD_TYPE_UNDEF, and VM_METHOD_TYPE_ZSUPER.
Referenced by gc_mark_imemo().
|
static |
Definition at line 4129 of file gc.c.
References gc_mark(), and ID_TABLE_CONTINUE.
Referenced by mark_m_tbl().
|
static |
Definition at line 4054 of file gc.c.
References mark_key(), st_data_t, and st_foreach.
Referenced by rb_mark_set().
|
static |
Definition at line 4211 of file gc.c.
References gc_mark_locations(), and rb_thread_struct::machine.
Referenced by mark_current_machine_context(), and rb_gc_mark_machine_stack().
|
static |
Definition at line 3763 of file gc.c.
References mark_stack::chunk, mark_stack::index, mark_stack::limit, stack_chunk::next, NULL, and size.
Referenced by gc_marks_continue(), gc_marks_finish(), and gc_marks_start().
|
static |
Definition at line 4039 of file gc.c.
References mark_entry(), st_table::num_entries, st_data_t, and st_foreach.
Referenced by gc_mark_children(), gc_mark_roots(), and rb_mark_tbl().
|
static |
Definition at line 9180 of file gc.c.
References rb_bug(), VM_METHOD_TYPE_ALIAS, VM_METHOD_TYPE_ATTRSET, VM_METHOD_TYPE_BMETHOD, VM_METHOD_TYPE_CFUNC, VM_METHOD_TYPE_ISEQ, VM_METHOD_TYPE_IVAR, VM_METHOD_TYPE_MISSING, VM_METHOD_TYPE_NOTIMPLEMENTED, VM_METHOD_TYPE_OPTIMIZED, VM_METHOD_TYPE_REFINED, VM_METHOD_TYPE_UNDEF, and VM_METHOD_TYPE_ZSUPER.
Referenced by rb_raw_obj_info().
|
static |
Definition at line 7580 of file gc.c.
References EXIT_FAILURE, negative_size_allocation_error_with_gvl(), rb_eNoMemError, rb_raise(), rb_thread_call_with_gvl(), ruby_native_thread_p(), and ruby_thread_has_gvl_p().
Referenced by objspace_xmalloc().
|
static |
Definition at line 7573 of file gc.c.
References rb_eNoMemError, and rb_raise().
Referenced by negative_size_allocation_error().
|
inlinestatic |
Definition at line 1783 of file gc.c.
References assert, BUILTIN_TYPE, check_rvalue_consistency(), FALSE, FL_PROMOTED1, FL_WB_PROTECTED, heap_page::flags, gc_mark_set(), gc_report, GET_HEAP_WB_UNPROTECTED_BITS, is_incremental_marking, MARK_IN_BITMAP, obj_info(), rb_objspace::profile, RANY, rb_bug(), rb_gc_writebarrier_remember(), rb_source_loc(), RB_TYPE_P, RBASIC, RBASIC_SET_CLASS_RAW, RGENGC_CHECK_MODE, RGENGC_OLD_NEWOBJ_CHECK, rgengc_remembered(), RVALUE_AGE_SET_OLD(), RVALUE_MARKED(), RVALUE_MARKING(), RVALUE_OLD_P(), RVALUE_WB_UNPROTECTED(), SPECIAL_CONST_P, T_ARRAY, T_NONE, rb_objspace::total_allocated_objects, and UNLIKELY.
Referenced by newobj_of(), and newobj_slowpath().
|
inlinestatic |
Definition at line 1905 of file gc.c.
References cnt, during_gc, gc_event_hook_available_p, heap_eden, heap_get_freeobj_head(), newobj_init(), newobj_slowpath_wb_protected(), newobj_slowpath_wb_unprotected(), Qfalse, RARRAY_CONST_PTR, RARRAY_LEN, rb_memerror(), rb_objspace, ruby_gc_stressful, stress_to_class, and UNLIKELY.
Referenced by rb_data_object_wrap(), rb_data_typed_object_wrap(), rb_imemo_new(), rb_newobj(), rb_newobj_of(), rb_node_newnode(), rb_wb_protected_newobj_of(), and rb_wb_unprotected_newobj_of().
|
inlinestatic |
Definition at line 1865 of file gc.c.
References dont_gc, during_gc, FALSE, heap_page::flags, garbage_collect(), gc_event_hook, GPR_FLAG_NEWOBJ, heap_eden, heap_get_freeobj(), newobj_init(), newobj_slowpath_wb_protected(), newobj_slowpath_wb_unprotected(), NOINLINE(), rb_bug(), rb_memerror(), ruby_gc_stressful, RUBY_INTERNAL_EVENT_NEWOBJ, and UNLIKELY.
Referenced by newobj_slowpath_wb_protected(), and newobj_slowpath_wb_unprotected().
|
static |
Definition at line 1893 of file gc.c.
References newobj_slowpath(), and TRUE.
Referenced by newobj_of(), and newobj_slowpath().
|
static |
Definition at line 1899 of file gc.c.
References FALSE, and newobj_slowpath().
Referenced by newobj_of(), and newobj_slowpath().
NOINLINE | ( | static VALUE | newobj_slowpath_wb_protectedVALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, rb_objspace_t *objspace | ) |
Referenced by gc_aging(), gc_mark_from(), newobj_slowpath(), and rgengc_mark_and_rememberset_clear().
NOINLINE | ( | static void | gc_mark_ptrrb_objspace_t *objspace, VALUE obj | ) |
NOINLINE | ( | static void | gc_writebarrier_generationalVALUE a, VALUE b, rb_objspace_t *objspace | ) |
|
static |
Definition at line 2116 of file gc.c.
References BIGNUM_DIGITS, BIGNUM_EMBED_FLAG, BUILTIN_TYPE, rmatch::char_offset, CHECK, CLEAR_IN_BITMAP, RZombie::data, DATA_PTR, FALSE, FL_EXIVAR, FL_FINALIZE, FL_TEST, FL_UNSET, gc_event_hook, GET_HEAP_WB_UNPROTECTED_BITS, imemo_env, imemo_iseq, imemo_ment, make_io_zombie(), make_zombie(), NULL, onig_free(), onig_region_free(), PRIxVALUE, RANY, rb_ary_free(), rb_bug(), rb_class_detach_module_subclasses(), rb_class_detach_subclasses(), rb_class_remove_from_module_subclasses(), rb_class_remove_from_super_subclasses(), rb_free_const_table(), rb_free_generic_ivar(), rb_free_method_entry(), rb_gc_free_dsymbol(), rb_gc_free_node(), rb_id_table_free(), rb_iseq_free(), rb_str_free(), RBASIC, RCLASS_CALLABLE_M_TBL, RCLASS_CONST_TBL, RCLASS_EXT, RCLASS_IV_INDEX_TBL, RCLASS_IV_TBL, RCLASS_M_TBL, rmatch::regs, RICLASS_IS_ORIGIN, ROBJECT_EMBED, RSTRUCT_EMBED_LEN_MASK, RTYPEDDATA_P, RUBY_DEFAULT_FREE, RUBY_INTERNAL_EVENT_FREEOBJ, RUBY_TYPED_FREE_IMMEDIATELY, RVALUE_MARKED(), RVALUE_MARKING(), RVALUE_UNCOLLECTIBLE(), RVALUE_WB_UNPROTECTED(), st_free_table, T_ARRAY, T_BIGNUM, T_CLASS, T_COMPLEX, T_DATA, T_FALSE, T_FILE, T_FIXNUM, T_FLOAT, T_HASH, T_ICLASS, T_IMEMO, T_MATCH, T_MODULE, T_NIL, T_NODE, T_OBJECT, T_RATIONAL, T_REGEXP, T_STRING, T_STRUCT, T_SYMBOL, T_TRUE, VM_ASSERT, VM_ENV_ESCAPED_P(), and xfree().
Referenced by gc_page_sweep().
Definition at line 9362 of file gc.c.
References obj_type_name().
Referenced by check_color_i(), check_generation_i(), check_rvalue_consistency(), gc_aging(), gc_grey(), gc_mark_roots(), gc_mark_stacked_objects(), gc_marks_wb_unprotected_objects(), gc_page_sweep(), gc_verify_heap_page(), gc_writebarrier_generational(), gc_writebarrier_incremental(), newobj_init(), rb_gc_force_recycle(), rb_gc_unprotect_logging(), rb_gc_writebarrier_remember(), rb_gc_writebarrier_unprotect(), rb_obj_info(), rb_raw_obj_info(), rgengc_check_relation(), rgengc_remember(), rgengc_remembered(), rgengc_rememberset_mark(), and RVALUE_AGE_INC().
|
static |
Definition at line 3149 of file gc.c.
References BDIGIT, BIGNUM_DIGITS, BIGNUM_EMBED_FLAG, BIGNUM_LEN, BUILTIN_TYPE, rmatch::char_offset_num_allocated, FL_EXIVAR, FL_TEST, onig_memsize(), onig_region_memsize(), rb_ary_memsize(), rb_bug(), rb_generic_ivar_memsize(), rb_id_table_memsize(), rb_io_memsize(), rb_node_memsize(), rb_objspace_data_type_memsize(), rb_str_memsize(), RBASIC, RCLASS, RCLASS_EXT, RCLASS_IV_INDEX_TBL, RCLASS_IV_TBL, RCLASS_M_TBL, rmatch::regs, RFILE, RHASH, RICLASS_IS_ORIGIN, RMATCH, ROBJECT, ROBJECT_EMBED, RREGEXP_PTR, RSTRUCT, RSTRUCT_EMBED_LEN_MASK, RSTRUCT_LEN, size, SPECIAL_CONST_P, st_memsize(), T_ARRAY, T_BIGNUM, T_CLASS, T_COMPLEX, T_DATA, T_FILE, T_FLOAT, T_HASH, T_ICLASS, T_IMEMO, T_MATCH, T_MODULE, T_NODE, T_OBJECT, T_RATIONAL, T_REGEXP, T_STRING, T_STRUCT, T_SYMBOL, and T_ZOMBIE.
Referenced by check_rvalue_consistency(), and rb_obj_memsize_of().
Definition at line 9174 of file gc.c.
References TYPE, and type_name().
Referenced by obj_info(), rb_obj_info(), and rb_raw_obj_info().
|
static |
Definition at line 3406 of file gc.c.
References heap_eden, and heap_tomb.
Referenced by gc_stat_internal(), and objspace_free_slots().
Definition at line 2358 of file gc.c.
References each_obj_args::callback, each_obj_args::data, heap_allocated_pages, heap_pages_sorted, NULL, Qnil, rb_objspace, heap_page::start, and heap_page::total_slots.
Referenced by gc_verify_internal_consistency(), rb_objspace_each_objects(), and rb_objspace_each_objects_without_setup().
|
static |
Definition at line 3418 of file gc.c.
References heap_pages_final_slots, objspace_available_slots(), and objspace_live_slots().
Referenced by gc_stat_internal().
|
static |
Definition at line 3412 of file gc.c.
References heap_pages_final_slots, rb_objspace::profile, rb_objspace::total_allocated_objects, and rb_objspace::total_freed_objects.
Referenced by gc_stat_internal(), gc_verify_internal_consistency(), and objspace_free_slots().
|
inlinestatic |
Definition at line 7814 of file gc.c.
References size.
Referenced by objspace_xcalloc(), and objspace_xmalloc0().
|
static |
Definition at line 7722 of file gc.c.
References garbage_collect_with_gvl(), gc_stress_full_mark_after_malloc_p, GPR_FLAG_MALLOC, GPR_FLAG_STRESS, ruby_gc_stressful, ruby_native_thread_p(), and TRUE.
|
static |
Definition at line 7730 of file gc.c.
References assert, ATOMIC_SIZE_ADD, ATOMIC_SIZE_INC, atomic_sub_nounderflow(), dont_gc, FALSE, garbage_collect_with_gvl(), gc_rest(), GPR_FLAG_MALLOC, heap_eden, is_lazy_sweeping, malloc_increase, malloc_limit, rb_objspace::malloc_params, MEMOP_TYPE_FREE, MEMOP_TYPE_MALLOC, MEMOP_TYPE_REALLOC, rb_objspace::oldmalloc_increase, rb_bug(), rb_objspace::rgengc, RGENGC_CHECK_MODE, ruby_native_thread_p(), and ruby_thread_has_gvl_p().
Referenced by objspace_xcalloc(), objspace_xfree(), objspace_xmalloc0(), objspace_xrealloc(), and rb_gc_adjust_memory_usage().
|
inlinestatic |
Definition at line 7802 of file gc.c.
References size.
Referenced by objspace_xcalloc(), and objspace_xmalloc0().
|
inlinestatic |
Definition at line 7694 of file gc.c.
Referenced by objspace_xcalloc(), objspace_xfree(), objspace_xmalloc0(), and objspace_xrealloc().
|
static |
Definition at line 7951 of file gc.c.
References calloc, MEMOP_TYPE_MALLOC, objspace_malloc_fixup(), objspace_malloc_increase(), objspace_malloc_prepare(), objspace_malloc_size(), size, TRY_WITH_GC, and xmalloc2_size().
Referenced by ruby_xcalloc().
|
static |
Definition at line 7911 of file gc.c.
References free(), MEMOP_TYPE_FREE, objspace_malloc_increase(), and objspace_malloc_size().
Referenced by objspace_xrealloc(), rb_objspace_reachable_objects_from_root(), and ruby_sized_xfree().
|
static |
Definition at line 7849 of file gc.c.
References negative_size_allocation_error(), and objspace_xmalloc0().
Referenced by objspace_xrealloc(), and ruby_xmalloc().
|
static |
Definition at line 7837 of file gc.c.
References malloc, MEMOP_TYPE_MALLOC, objspace_malloc_fixup(), objspace_malloc_increase(), objspace_malloc_prepare(), objspace_malloc_size(), and TRY_WITH_GC.
Referenced by objspace_xmalloc(), objspace_xmalloc2(), and ruby_xmalloc0().
|
static |
Definition at line 7868 of file gc.c.
References objspace_xmalloc0(), and xmalloc2_size().
Referenced by ruby_xmalloc2().
|
static |
Definition at line 7874 of file gc.c.
References MEMOP_TYPE_REALLOC, objspace_malloc_increase(), objspace_malloc_size(), objspace_xfree(), objspace_xmalloc(), realloc, and TRY_WITH_GC.
Referenced by ruby_sized_xrealloc(), and ruby_sized_xrealloc2().
Definition at line 2566 of file gc.c.
References os_each_struct::of, os_obj_of(), rb_scan_args(), and RETURN_ENUMERATOR.
Referenced by Init_GC().
Definition at line 2519 of file gc.c.
References os_each_struct::num, os_each_struct::of, os_obj_of_i(), rb_objspace_each_objects(), and SIZET2NUM.
Referenced by os_each_obj().
|
static |
Definition at line 2500 of file gc.c.
References internal_object_p(), os_each_struct::num, os_each_struct::of, rb_obj_is_kind_of(), and rb_yield().
Referenced by os_obj_of().
|
static |
Definition at line 3854 of file gc.c.
References mark_stack::chunk, stack_chunk::data, FALSE, mark_stack::index, is_mark_stack_empty(), pop_mark_stack_chunk(), and TRUE.
Referenced by gc_mark_roots(), and gc_mark_stacked_objects().
|
static |
Definition at line 3820 of file gc.c.
References add_stack_chunk_cache(), assert, mark_stack::chunk, mark_stack::index, mark_stack::limit, stack_chunk::next, heap_page::prev, and RGENGC_CHECK_MODE.
Referenced by pop_mark_stack().
PRINTF_ARGS | ( | static void | gc_report_bodyint level, rb_objspace_t *objspace, const char *fmt,..., |
3 | , | ||
4 | |||
) |
PUREFUNC | ( | static inline int | is_id_valuerb_objspace_t *objspace, VALUE ptr | ) |
Referenced by rb_objspace_call_finalizer(), and rb_objspace_data_type_name().
|
static |
Definition at line 3845 of file gc.c.
References mark_stack::chunk, stack_chunk::data, mark_stack::index, mark_stack::limit, and push_mark_stack_chunk().
Referenced by gc_grey(), and gc_mark_roots().
|
static |
Definition at line 3798 of file gc.c.
References assert, mark_stack::cache, mark_stack::cache_size, mark_stack::chunk, mark_stack::index, mark_stack::limit, stack_chunk::next, heap_page::next, RGENGC_CHECK_MODE, stack_chunk_alloc(), and mark_stack::unused_cache_size.
Referenced by push_mark_stack().
void* rb_alloc_tmp_buffer | ( | volatile VALUE * | store, |
long | len | ||
) |
Definition at line 8066 of file gc.c.
References cnt, rb_alloc_tmp_buffer_with_count(), rb_eArgError, rb_raise(), and roomof.
void* rb_alloc_tmp_buffer_with_count | ( | volatile VALUE * | store, |
size_t | size, | ||
size_t | cnt | ||
) |
Definition at line 8052 of file gc.c.
References RNode::cnt, cnt, NODE_ALLOCA, rb_node_newnode(), ruby_xmalloc0(), RNode::u1, RNode::u3, and RNode::value.
Referenced by rb_alloc_tmp_buffer().
Definition at line 6031 of file gc.c.
References check_rvalue_consistency(), GET_HEAP_WB_UNPROTECTED_BITS, MARK_IN_BITMAP, rb_objspace, RVALUE_AGE_RESET_RAW(), RVALUE_DEMOTE(), RVALUE_OLD_P(), and RVALUE_WB_UNPROTECTED().
Referenced by init_copy().
VALUE rb_data_object_wrap | ( | VALUE | klass, |
void * | datap, | ||
RUBY_DATA_FUNC | dmark, | ||
RUBY_DATA_FUNC | dfree | ||
) |
Definition at line 1988 of file gc.c.
References Check_Type, FALSE, newobj_of(), T_CLASS, and T_DATA.
Referenced by rb_data_object_alloc(), rb_data_typed_object_make(), and RUBY_ALIAS_FUNCTION().
VALUE rb_data_typed_object_wrap | ( | VALUE | klass, |
void * | datap, | ||
const rb_data_type_t * | type | ||
) |
Definition at line 2009 of file gc.c.
References Check_Type, rb_data_type_struct::flags, newobj_of(), RUBY_FL_WB_PROTECTED, T_CLASS, and T_DATA.
Referenced by rb_data_object_alloc(), rb_data_typed_object_alloc(), and RUBY_ALIAS_FUNCTION().
Definition at line 2690 of file gc.c.
References define_final0(), should_be_callable(), and should_be_finalizable().
Referenced by rb_obj_info_dump().
int rb_during_gc | ( | void | ) |
Definition at line 6664 of file gc.c.
References during_gc, hash(), ID2SYM, name, rb_hash_aset(), rb_hash_new(), rb_intern, rb_objspace, result, SIZET2NUM, T_MASK, and type_name().
Referenced by rb_exec_async_signal_safe(), and ruby_thread_stack_overflow().
void rb_free_const_table | ( | struct rb_id_table * | tbl | ) |
Definition at line 2091 of file gc.c.
References free_const_entry_i(), rb_id_table_foreach_values(), and rb_id_table_free().
Referenced by obj_free(), and rb_mod_init_copy().
void rb_free_tmp_buffer | ( | volatile VALUE * | store | ) |
Definition at line 8078 of file gc.c.
References ATOMIC_PTR_EXCHANGE, ATOMIC_VALUE_EXCHANGE, rb_objspace::malloc_params, RNODE, ruby_xfree(), and UINT2NUM.
int rb_garbage_collect | ( | void | ) |
Definition at line 6580 of file gc.c.
References garbage_collect(), GPR_FLAG_CAPI, and TRUE.
void rb_gc | ( | void | ) |
Definition at line 6656 of file gc.c.
References garbage_collect(), gc_finalize_deferred(), GPR_FLAG_CAPI, rb_objspace, and TRUE.
Referenced by cont_restore_thread(), getDevice(), rb_exec_async_signal_safe(), rb_fdopen(), rb_gc_for_fd(), rb_gc_start(), rb_reg_region_copy(), and rsock_s_accept().
void rb_gc_adjust_memory_usage | ( | ssize_t | diff | ) |
Definition at line 8121 of file gc.c.
References MEMOP_TYPE_REALLOC, objspace_malloc_increase(), and rb_objspace.
void rb_gc_call_finalizer_at_exit | ( | void | ) |
Definition at line 2850 of file gc.c.
References gc_verify_internal_consistency(), Qnil, and rb_objspace_call_finalizer().
Referenced by ruby_finalize_1().
Definition at line 2698 of file gc.c.
References finalizer_table, FL_FINALIZE, FL_SET, FL_TEST, rb_objspace, st_data_t, st_insert, st_lookup, and code_page_table::table.
Referenced by init_copy().
size_t rb_gc_count | ( | void | ) |
Definition at line 6688 of file gc.c.
References rb_objspace::count, and rb_objspace::profile.
Referenced by gc_count(), gc_page_sweep(), gc_reset_malloc_info(), and newobj_i().
VALUE rb_gc_disable | ( | void | ) |
Definition at line 7311 of file gc.c.
References dont_gc, gc_rest(), Qfalse, Qtrue, rb_objspace, and TRUE.
Referenced by gc_mark_roots(), and Init_GC().
VALUE rb_gc_enable | ( | void | ) |
Definition at line 7289 of file gc.c.
References dont_gc, FALSE, Qfalse, Qtrue, and rb_objspace.
Referenced by gc_mark_roots(), and Init_GC().
void rb_gc_finalize_deferred | ( | void | ) |
Definition at line 2818 of file gc.c.
References gc_finalize_deferred().
void rb_gc_force_recycle | ( | VALUE | obj | ) |
Definition at line 6102 of file gc.c.
References CLEAR_IN_BITMAP, gc_report, GET_HEAP_MARK_BITS, GET_HEAP_MARKING_BITS, GET_HEAP_PAGE, GET_HEAP_UNCOLLECTIBLE_BITS, GET_HEAP_WB_UNPROTECTED_BITS, heap_page_add_freeobj(), invalidate_mark_stack(), is_incremental_marking, rb_objspace::mark_stack, MARKED_IN_BITMAP, obj_info(), rb_objspace::old_objects, rb_objspace::profile, rb_objspace, rb_objspace::rgengc, RVALUE_MARKED(), RVALUE_OLD_P(), and rb_objspace::total_freed_objects.
Referenced by dispose_string(), literal_concat_gen(), new_regexp_gen(), parser_heredoc_restore(), parser_yylex(), rb_ary_decrement_share(), rb_f_backquote(), rb_parser_free(), rb_str_tmp_frozen_release(), rb_thread_inspect(), str_cat_conv_enc_opts(), and yyparse().
Definition at line 96 of file gc.c.
References rb_gc_guarded_val, and val.
Definition at line 6803 of file gc.c.
References gc_info_decode(), and rb_objspace.
void rb_gc_mark | ( | VALUE | ptr | ) |
Definition at line 4394 of file gc.c.
References gc_mark().
Referenced by addrinfo_mark(), argf_mark(), autoload_i_mark(), backtrace_mark(), bm_mark(), cont_mark(), cparse_params_mark(), d_lite_gc_mark(), dir_mark(), enumerator_mark(), fiddle_ptr_mark(), gc_mark_roots(), gen_ivtbl_mark(), generator_mark(), gzfile_mark(), ibf_dump_mark(), ibf_loader_mark(), iow_mark(), iseqw_mark(), location_mark(), location_mark_entry(), mark_dump_arg(), mark_exec_arg(), mark_marshal_compat_i(), parser_mark(), proc_entry_mark(), random_mark(), rb_fiber_mark_self(), rb_gc_mark_node(), rb_iseq_mark(), rb_mark_end_proc(), rb_thread_mark(), rb_vm_mark(), rb_vm_trace_mark_event_hooks(), strio_mark(), strscan_mark(), thread_shield_mark(), time_mark(), tp_mark(), wmap_mark(), yielder_mark(), and zstream_mark().
Definition at line 4008 of file gc.c.
References gc_mark_locations().
Referenced by cont_mark(), name_err_mesg_mark(), rb_gc_mark_node(), and rb_thread_mark().
void rb_gc_mark_machine_stack | ( | rb_thread_t * | th | ) |
Definition at line 4201 of file gc.c.
References GET_STACK_BOUNDS, mark_stack_locations(), rb_objspace_of, and rb_thread_struct::vm.
Referenced by rb_thread_mark().
void rb_gc_mark_maybe | ( | VALUE | obj | ) |
Definition at line 4247 of file gc.c.
References gc_mark_maybe().
Referenced by gc_mark_roots(), JSON_mark(), mark_global_entry(), rb_gc_mark_node(), rb_gvar_val_marker(), and rb_gvar_var_marker().
Definition at line 4024 of file gc.c.
References gc_mark_values(), and rb_objspace.
Referenced by rb_thread_mark().
void rb_gc_register_address | ( | VALUE * | addr | ) |
Definition at line 6168 of file gc.c.
References ALLOC, global_list, gc_list::next, rb_objspace, and gc_list::varptr.
Referenced by Init_readline(), and rb_global_variable().
void rb_gc_register_mark_object | ( | VALUE | obj | ) |
Definition at line 6154 of file gc.c.
References GET_THREAD, MARK_OBJECT_ARY_BUCKET_SIZE, Qnil, RARRAY_LEN, rb_ary_last(), rb_ary_push(), and rb_ary_tmp_new().
Referenced by compat_allocator_table(), date__strptime_internal(), gc_stat_internal(), Init_class_hierarchy(), Init_date_core(), Init_Encoding(), Init_IO(), Init_load(), Init_Random_default(), Init_sym(), Init_VM(), Init_win32ole(), Init_win32ole_event(), power_cache_get_power(), pruby_init(), rb_define_class_id_under(), rb_define_module_id_under(), rb_iseq_defined_string(), rb_sym_to_proc(), rb_vm_register_special_exception(), regcomp(), rt_complete_frags(), ruby_process_options(), and setup_gc_stat_symbols().
size_t rb_gc_stat | ( | VALUE | key | ) |
Definition at line 7217 of file gc.c.
References gc_stat_internal(), and SYMBOL_P.
void rb_gc_unprotect_logging | ( | void * | objptr, |
const char * | filename, | ||
int | line | ||
) |
Definition at line 6001 of file gc.c.
References cnt, malloc, obj_info(), rb_memerror(), rgengc_unprotect_logging_exit_func(), RVALUE_WB_UNPROTECTED(), snprintf, st_data_t, st_init_strtable, st_insert, st_lookup, and strlen().
void rb_gc_unregister_address | ( | VALUE * | addr | ) |
Definition at line 6180 of file gc.c.
References global_list, gc_list::next, rb_objspace, gc_list::varptr, and xfree().
void rb_gc_verify_internal_consistency | ( | void | ) |
Definition at line 5298 of file gc.c.
References gc_verify_internal_consistency(), and Qnil.
Referenced by vm_pop_frame().
Definition at line 5910 of file gc.c.
References gc_writebarrier_generational(), gc_writebarrier_incremental(), is_incremental_marking, rb_bug(), rb_objspace, RGENGC_CHECK_MODE, RVALUE_OLD_P(), and SPECIAL_CONST_P.
Referenced by rb_obj_written().
void rb_gc_writebarrier_remember | ( | VALUE | obj | ) |
Definition at line 5967 of file gc.c.
References gc_grey(), gc_report, is_incremental_marking, obj_info(), rb_objspace, rgengc_remember(), RVALUE_BLACK_P(), and RVALUE_OLD_P().
Referenced by ary_memcpy0(), newobj_init(), rb_ary_modify(), rb_hash_keys(), rb_hash_values(), and vm_env_write_slowpath().
void rb_gc_writebarrier_unprotect | ( | VALUE | obj | ) |
Definition at line 5931 of file gc.c.
References BUILTIN_TYPE, gc_mark_set(), gc_remember_unprotected(), gc_report, GET_HEAP_WB_UNPROTECTED_BITS, MARK_IN_BITMAP, obj_info(), rb_objspace::profile, rb_objspace, rgengc_remembered(), RVALUE_AGE_RESET(), RVALUE_DEMOTE(), RVALUE_OLD_P(), and RVALUE_WB_UNPROTECTED().
Referenced by rb_obj_wb_unprotect().
void rb_gcdebug_print_obj_condition | ( | VALUE | obj | ) |
Referenced by gc_mark_children(), and rb_obj_info_dump().
void rb_global_variable | ( | VALUE * | var | ) |
Definition at line 6203 of file gc.c.
References rb_gc_register_address().
Referenced by Init_openssl(), Init_ossl_asn1(), and Init_Regexp().
Definition at line 1971 of file gc.c.
References FL_USHIFT, newobj_of(), rb_imemo_new(), T_IMEMO, and TRUE.
Referenced by iseq_imemo_alloc(), rb_imemo_new(), rb_method_entry_alloc(), svar_new(), THROW_DATA_NEW(), vm_cref_new0(), and vm_env_new().
Definition at line 70 of file iseq.c.
References rb_iseq_struct::body, rb_iseq_constant_body::catch_table, rb_iseq_constant_body::cc_entries, rb_iseq_constant_body::ci_entries, rb_iseq_constant_body::ci_kw_size, rb_iseq_constant_body::ci_size, compile_data_free(), rb_iseq_constant_body::is_entries, ISEQ_COMPILE_DATA, rb_iseq_constant_body::iseq_encoded, rb_iseq_constant_body::keyword, rb_call_info_with_kwarg::kw_arg, rb_iseq_constant_body::line_info_table, rb_iseq_constant_body::local_table, NULL, rb_iseq_constant_body::opt_table, rb_iseq_constant_body::param, RUBY_FREE_ENTER, RUBY_FREE_LEAVE, and ruby_xfree().
Referenced by obj_free().
Definition at line 106 of file iseq.c.
References rb_iseq_location_struct::absolute_path, rb_iseq_struct::aux, rb_iseq_location_struct::base_label, rb_iseq_struct::body, iseq_compile_data::catch_table_ary, iseq_compile_data::err_info, FL_TEST, ISEQ_COMPILE_DATA, ISEQ_NOT_LOADED_YET, rb_iseq_location_struct::label, rb_iseq_struct::loader, rb_iseq_constant_body::location, iseq_compile_data::mark_ary, rb_iseq_constant_body::mark_ary, rb_iseq_constant_body::parent_iseq, rb_iseq_location_struct::path, rb_gc_mark(), RSTRING_PTR, RUBY_GC_INFO, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, and RUBY_MARK_UNLESS_NULL.
Referenced by gc_mark_imemo().
void rb_mark_hash | ( | st_table * | tbl | ) |
Definition at line 4084 of file gc.c.
References mark_hash().
Referenced by com_hash_mark(), mark_dump_arg(), and mark_load_arg().
void rb_mark_set | ( | st_table * | tbl | ) |
void rb_mark_tbl | ( | st_table * | tbl | ) |
Definition at line 4229 of file gc.c.
References mark_tbl().
Referenced by autoload_mark(), mark_load_arg(), rb_thread_mark(), and rb_vm_mark().
void rb_memerror | ( | void | ) |
Definition at line 7622 of file gc.c.
References during_gc, EXIT_FAILURE, gc_exit(), GET_THREAD, nomem_error, RAISED_NOMEMORY, rb_exc_raise(), rb_objspace_of, rb_thread_raised_clear, rb_thread_raised_p, rb_thread_raised_set, TAG_RAISE, TH_JUMP_TAG, and rb_thread_struct::vm.
Referenced by compile_data_alloc(), gc_heap_prepare_minimum_pages(), gc_prof_setup_new_record(), gc_profile_clear(), heap_page_allocate(), heap_pages_expand_sorted_to(), heap_prepare(), match_init_copy(), newobj_of(), newobj_slowpath(), nsdr(), rb_gc_unprotect_logging(), rb_reg_search0(), readline_attempted_completion_function(), ruby_memerror(), ruby_memerror_body(), stack_chunk_alloc(), and strscan_init_copy().
VALUE rb_newobj | ( | void | ) |
Definition at line 1949 of file gc.c.
References FALSE, newobj_of(), and T_NONE.
Definition at line 1955 of file gc.c.
References FL_WB_PROTECTED, and newobj_of().
Referenced by dsymbol_alloc().
Definition at line 1961 of file gc.c.
References FALSE, nd_set_type, newobj_of(), and T_NODE.
Referenced by rb_alloc_tmp_buffer_with_count().
Definition at line 6069 of file gc.c.
References GET_HEAP_MARK_BITS, GET_HEAP_MARKING_BITS, I, MARKED_IN_BITMAP, RVALUE_OLD_P(), RVALUE_UNCOLLECTIBLE(), and RVALUE_WB_UNPROTECTED().
Referenced by dump_object(), and Init_objspace_dump().
Definition at line 3100 of file gc.c.
References FIXNUM_FLAG, FLONUM_P, LONG2NUM, nonspecial_obj_id, SIGNED_VALUE, SPECIAL_CONST_P, STATIC_SYM_P, and SYM2ID.
Referenced by exec_recursive(), Init_GC(), iow_internal_object_id(), rb_exec_recursive_paired(), rb_exec_recursive_paired_outer(), and rb_obj_equal().
Definition at line 9369 of file gc.c.
References obj_info(), obj_type_name(), and rb_special_const_p().
Referenced by check_cref(), check_method_entry(), filter_defined_class(), rb_vm_env_write(), and vm_stackoverflow().
void rb_obj_info_dump | ( | VALUE | obj | ) |
Definition at line 9380 of file gc.c.
References argc, argv, GET_HEAP_MARK_BITS, heap_eden, is_lazy_sweeping, is_pointer_to_heap(), is_swept_object(), MARKED_IN_BITMAP, Qnil, RANY, RARRAY_LEN, rb_ary_cat(), rb_ary_delete_same(), rb_ary_tmp_new(), rb_define_finalizer(), rb_gcdebug_print_obj_condition(), rb_objspace, rb_proc_new(), rb_raw_obj_info(), RVALUE_OLD_P(), RVALUE_REMEMBERED(), RVALUE_WB_UNPROTECTED(), and stress_to_class.
Referenced by ibf_dump_object_class(), ibf_dump_object_unsupported(), and rb_class_clear_method_cache().
size_t rb_obj_memsize_of | ( | VALUE | obj | ) |
Definition at line 3266 of file gc.c.
References obj_memsize_of(), and TRUE.
Referenced by cos_i(), dump_object(), iow_size(), memsize_of_m(), and total_i().
Definition at line 6063 of file gc.c.
References OBJ_PROMOTED, Qfalse, and Qtrue.
Definition at line 6053 of file gc.c.
References Qfalse, Qtrue, and RVALUE_WB_UNPROTECTED().
rb_objspace_t* rb_objspace_alloc | ( | void | ) |
Definition at line 1305 of file gc.c.
References calloc, free_stack_chunks(), heap_page_free(), malloc_limit, ruby_gc_params_t::malloc_limit_min, and rb_objspace.
Referenced by Init_BareVM().
|
static |
Definition at line 2859 of file gc.c.
References assert, ATOMIC_EXCHANGE, ATOMIC_SET, BUILTIN_TYPE, DATA_PTR, dont_gc, rb_objspace::dont_incremental, finalize_deferred(), finalize_list(), finalizer_table, finalizing, rb_objspace::flags, force_chain_object(), gc_enter(), gc_exit(), gc_rest(), heap_allocated_pages, heap_pages_deferred_final, heap_pages_sorted, is_id_value(), list, make_io_zombie(), make_zombie(), force_finalize_list::next, force_finalize_list::obj, PUREFUNC(), RANY, rb_obj_is_fiber(), rb_obj_is_mutex(), rb_obj_is_thread(), RDATA, RTYPEDDATA_P, run_finalizer(), st_data_t, st_delete, st_foreach, st_free_table, T_DATA, T_FILE, force_finalize_list::table, and xfree().
Referenced by rb_gc_call_finalizer_at_exit().
size_t rb_objspace_data_type_memsize | ( | VALUE | obj | ) |
Definition at line 2029 of file gc.c.
References rb_data_type_struct::dsize, rb_data_type_struct::function, RTYPEDDATA_DATA, RTYPEDDATA_P, and RTYPEDDATA_TYPE.
Referenced by obj_memsize_of().
Definition at line 2042 of file gc.c.
References is_pointer_to_heap(), PUREFUNC(), RTYPEDDATA_P, and RTYPEDDATA_TYPE.
Referenced by cto_i(), rb_raw_obj_info(), and type_name().
void rb_objspace_each_objects | ( | each_obj_callback * | callback, |
void * | data | ||
) |
Definition at line 2431 of file gc.c.
References callback(), each_obj_args::callback, each_obj_args::data, gc_rest(), incremental_enable(), objspace_each_objects(), Qnil, rb_ensure(), rb_objspace, and TRUE.
Referenced by count_imemo_objects(), count_nodes(), count_objects_size(), count_symbols(), count_tdata_objects(), memsize_of_all_m(), objspace_dump_all(), and os_obj_of().
void rb_objspace_each_objects_without_setup | ( | each_obj_callback * | callback, |
void * | data | ||
) |
Definition at line 2452 of file gc.c.
References callback(), each_obj_args::callback, each_obj_args::data, and objspace_each_objects().
void rb_objspace_free | ( | rb_objspace_t * | objspace | ) |
Definition at line 1321 of file gc.c.
References rb_objspace::eden_heap, free(), free_stack_chunks(), global_list, heap_allocated_pages, heap_eden, heap_page_free(), heap_pages_himem, heap_pages_lomem, heap_pages_sorted, heap_pages_sorted_length, is_lazy_sweeping, list, rb_objspace::mark_stack, gc_list::next, NULL, rb_heap_struct::pages, rb_objspace::profile, rb_bug(), rb_objspace::records, rb_heap_struct::total_pages, rb_heap_struct::total_slots, and xfree().
Referenced by ruby_vm_destruct().
int rb_objspace_garbage_object_p | ( | VALUE | obj | ) |
Definition at line 3014 of file gc.c.
References is_garbage_object(), and rb_objspace.
Referenced by dsymbol_check(), fstr_update_callback(), and symbols_i().
int rb_objspace_internal_object_p | ( | VALUE | obj | ) |
Definition at line 2494 of file gc.c.
References internal_object_p().
Referenced by reachable_object_from_i(), and reachable_object_from_root_i().
int rb_objspace_markable_object_p | ( | VALUE | obj | ) |
Definition at line 3007 of file gc.c.
References is_live_object(), is_markable_object(), and rb_objspace.
Referenced by reachable_object_from_i(), reachable_object_from_root_i(), and reachable_objects_from().
int rb_objspace_marked_object_p | ( | VALUE | obj | ) |
Definition at line 4404 of file gc.c.
References FALSE, RVALUE_MARKED(), and TRUE.
Definition at line 7521 of file gc.c.
References func, gc_mark_children(), is_markable_object(), POP_MARK_FUNC_DATA, PUSH_MARK_FUNC_DATA, and rb_objspace.
Referenced by dump_object(), gc_mark_roots(), reachable_objects_from(), and verify_internal_consistency_i().
void rb_objspace_reachable_objects_from_root | ( | void(func)(const char *category, VALUE, void *) | , |
void * | passing_data | ||
) |
Definition at line 7549 of file gc.c.
References root_objects_data::category, root_objects_data::data, func, root_objects_data::func, gc_mark_roots(), objspace_xfree(), POP_MARK_FUNC_DATA, PUSH_MARK_FUNC_DATA, rb_objspace, root_objects_from(), and size.
Referenced by objspace_dump_all(), and reachable_objects_from_root().
void rb_objspace_set_event_hook | ( | const rb_event_flag_t | event | ) |
Definition at line 1760 of file gc.c.
References rb_objspace::flags, rb_objspace::has_hook, rb_objspace::hook_events, rb_objspace, and RUBY_INTERNAL_EVENT_OBJSPACE_MASK.
Referenced by recalc_add_ruby_vm_event_flags(), and recalc_remove_ruby_vm_event_flags().
Definition at line 9208 of file gc.c.
References rb_iseq_struct::body, rb_iseq_location_struct::first_lineno, FIX2INT, rb_iseq_location_struct::label, rb_iseq_constant_body::location, rb_iseq_location_struct::path, RSTRING_PTR, and snprintf.
Referenced by rb_raw_obj_info().
Definition at line 9219 of file gc.c.
References rb_method_definition_struct::alias_count, ARY_EMBED_P, ARY_SHARED_P, BUILTIN_TYPE, C, rb_method_entry_struct::called_id, rb_method_entry_struct::def, rb_method_entry_struct::defined_class, env, imemo_iseq, imemo_ment, IMEMO_NAME, internal_object_p(), method_type_name(), nd_type, NIL_P, NULL, obj_info(), obj_type_name(), rb_method_entry_struct::owner, RANY, RARRAY_LEN, rb_class_path_cached(), rb_id2name(), rb_obj_is_proc(), rb_objspace_data_type_name(), rb_raw_iseq_info(), rb_raw_obj_info(), RBASIC, RSTRING_PTR, ruby_node_name(), RVALUE_FLAGS_AGE(), RVALUE_MARK_BITMAP, RVALUE_MARKING_BITMAP, RVALUE_UNCOLLECTIBLE_BITMAP, RVALUE_WB_UNPROTECTED_BITMAP, snprintf, SPECIAL_CONST_P, T_ARRAY, T_CLASS, T_DATA, T_IMEMO, T_NODE, T_STRING, rb_method_definition_struct::type, and vm_proc_iseq().
Referenced by rb_obj_info_dump(), rb_raw_obj_info(), and ruby_debug_print_value().
Definition at line 2595 of file gc.c.
References finalizer_table, FL_FINALIZE, FL_UNSET, rb_check_frozen, rb_objspace, st_data_t, and st_delete.
Referenced by undefine_final().
Definition at line 1940 of file gc.c.
References assert, FL_WB_PROTECTED, newobj_of(), RGENGC_CHECK_MODE, and TRUE.
Definition at line 1933 of file gc.c.
References assert, FALSE, FL_WB_PROTECTED, newobj_of(), and RGENGC_CHECK_MODE.
|
static |
Definition at line 6232 of file gc.c.
References dont_gc, during_gc, FALSE, heap_eden, heap_ready_to_gc(), and TRUE.
Referenced by gc_start().
|
static |
Definition at line 4287 of file gc.c.
References assert, gc_grey(), gc_remember_unprotected(), gc_report, is_incremental_marking, obj_info(), rb_objspace::parent_object, rb_objspace::rgengc, RGENGC_CHECK_MODE, rgengc_remember(), RVALUE_AGE_SET_CANDIDATE(), RVALUE_AGE_SET_OLD(), RVALUE_MARKED(), RVALUE_MARKING(), RVALUE_OLD_P(), and RVALUE_WB_UNPROTECTED().
Referenced by gc_mark_from(), and gc_mark_ptr().
|
static |
Definition at line 5813 of file gc.c.
References FALSE, heap_page::flags, gc_writebarrier_generational(), heap_page::has_remembered_objects, heap_page::has_uncollectible_shady_objects, HEAP_PAGE_BITMAP_SIZE, heap_page::mark_bits, heap_page::marking_bits, heap_page::next, NOINLINE(), rb_heap_struct::pages, and heap_page::uncollectible_bits.
Referenced by gc_marks_start().
|
static |
Definition at line 5706 of file gc.c.
References BUILTIN_TYPE, check_rvalue_consistency(), gc_report, obj_info(), rb_objspace::profile, rb_bug(), RGENGC_CHECK_MODE, rgengc_remembered(), rgengc_remembersetbits_get(), rgengc_remembersetbits_set(), and RVALUE_WB_UNPROTECTED().
Referenced by gc_writebarrier_generational(), rb_gc_writebarrier_remember(), and rgengc_check_relation().
|
static |
Definition at line 5732 of file gc.c.
References check_rvalue_consistency(), gc_report, obj_info(), result, and rgengc_remembersetbits_get().
Referenced by gc_page_sweep(), gc_writebarrier_generational(), newobj_init(), rb_gc_writebarrier_unprotect(), and rgengc_remember().
|
static |
Definition at line 5745 of file gc.c.
References assert, BITS_BITLENGTH, FALSE, heap_page::flags, gc_mark_children(), gc_report, heap_page::has_remembered_objects, heap_page::has_uncollectible_shady_objects, HEAP_PAGE_BITMAP_LIMIT, heap_page::marking_bits, heap_page::next, NUM_IN_PAGE, obj_info(), rb_heap_struct::pages, RGENGC_CHECK_MODE, RVALUE_OLD_P(), RVALUE_UNCOLLECTIBLE(), RVALUE_WB_UNPROTECTED(), heap_page::start, heap_page::uncollectible_bits, and heap_page::wb_unprotected_bits.
Referenced by gc_marks_start().
|
static |
Definition at line 5679 of file gc.c.
References RVALUE_REMEMBERED().
Referenced by rgengc_remember(), and rgengc_remembered().
|
static |
Definition at line 5685 of file gc.c.
References assert, FALSE, heap_page::flags, GET_HEAP_PAGE, heap_page::has_remembered_objects, is_incremental_marking, MARK_IN_BITMAP, MARKED_IN_BITMAP, heap_page::marking_bits, RGENGC_CHECK_MODE, and TRUE.
Referenced by rgengc_remember().
|
static |
Definition at line 5995 of file gc.c.
References rgengc_unprotect_logging_exit_func_i(), and st_foreach.
Referenced by rb_gc_unprotect_logging().
|
static |
Definition at line 5988 of file gc.c.
References ST_CONTINUE.
Referenced by rgengc_unprotect_logging_exit_func().
|
static |
Definition at line 7542 of file gc.c.
References root_objects_data::category, root_objects_data::data, and root_objects_data::func.
Referenced by rb_objspace_reachable_objects_from_root().
RUBY_ALIAS_FUNCTION | ( | rb_data_object_alloc(VALUE klass, void *datap, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree) | , |
rb_data_object_wrap | , | ||
(klass, datap, dmark, dfree) | |||
) |
Definition at line 1995 of file gc.c.
References DATA_PTR, rb_data_object_wrap(), and xcalloc.
RUBY_ALIAS_FUNCTION | ( | rb_data_typed_object_alloc(VALUE klass, void *datap, const rb_data_type_t *type) | , |
rb_data_typed_object_wrap | , | ||
(klass, datap, type) | |||
) |
Definition at line 2016 of file gc.c.
References DATA_PTR, rb_data_typed_object_wrap(), and xcalloc.
void ruby_gc_set_params | ( | int | safe_level | ) |
Definition at line 7475 of file gc.c.
References FALSE, gc_set_initial_pages(), get_envparam_double(), get_envparam_size(), ruby_gc_params_t::growth_factor, ruby_gc_params_t::growth_max_slots, ruby_gc_params_t::heap_free_slots, ruby_gc_params_t::heap_free_slots_goal_ratio, ruby_gc_params_t::heap_free_slots_max_ratio, ruby_gc_params_t::heap_free_slots_min_ratio, ruby_gc_params_t::heap_init_slots, ruby_gc_params_t::malloc_limit_growth_factor, ruby_gc_params_t::malloc_limit_max, ruby_gc_params_t::malloc_limit_min, rb_objspace::oldmalloc_increase_limit, ruby_gc_params_t::oldmalloc_limit_growth_factor, ruby_gc_params_t::oldmalloc_limit_max, ruby_gc_params_t::oldmalloc_limit_min, ruby_gc_params_t::oldobject_limit_factor, rb_objspace, rb_warn(), rb_objspace::rgengc, and TRUE.
Referenced by process_options().
int ruby_get_stack_grow_direction | ( | volatile VALUE * | addr | ) |
Definition at line 3936 of file gc.c.
References SET_MACHINE_STACK_END.
void ruby_malloc_size_overflow | ( | size_t | count, |
size_t | elsize | ||
) |
Definition at line 7937 of file gc.c.
References PRIuSIZE, rb_eArgError, and rb_raise().
Referenced by rb_alloc_tmp_buffer2(), and xmalloc2_size().
|
static |
Definition at line 7604 of file gc.c.
References EXIT_FAILURE, rb_memerror(), rb_thread_call_with_gvl(), ruby_memerror_body(), ruby_native_thread_p(), and ruby_thread_has_gvl_p().
|
static |
void ruby_mimfree | ( | void * | ptr | ) |
void* ruby_mimmalloc | ( | size_t | size | ) |
void ruby_sized_xfree | ( | void * | x, |
size_t | size | ||
) |
Definition at line 8009 of file gc.c.
References objspace_xfree().
Referenced by free_io_buffer(), rb_ary_free(), rb_ary_initialize(), rb_ary_replace(), rb_ary_sort_bang(), rb_str_free(), ruby_xfree(), str_discard(), tr_trans(), wmap_final_func(), wmap_finalize(), and wmap_free_map().
void* ruby_sized_xrealloc | ( | void * | ptr, |
size_t | new_size, | ||
size_t | old_size | ||
) |
Definition at line 7975 of file gc.c.
References objspace_xrealloc().
Referenced by ruby_xrealloc().
void* ruby_sized_xrealloc2 | ( | void * | ptr, |
size_t | n, | ||
size_t | size, | ||
size_t | old_n | ||
) |
Definition at line 7990 of file gc.c.
References len, objspace_xrealloc(), rb_eArgError, and rb_raise().
Referenced by ruby_xrealloc2(), wmap_aset_update(), and wmap_final_func().
void* ruby_xcalloc | ( | size_t | n, |
size_t | size | ||
) |
Definition at line 7966 of file gc.c.
References objspace_xcalloc().
Referenced by getifaddrs(), and rb_iseq_defined_string().
void ruby_xfree | ( | void * | x | ) |
Definition at line 8017 of file gc.c.
References ruby_sized_xfree().
Referenced by ary_resize_capa(), backtrace_free(), binding_free(), compile_data_free(), cont_free(), cState_array_nl_set(), cState_indent_set(), cState_object_nl_set(), cState_space_before_set(), cState_space_set(), delete_unique_str(), fbuffer_free(), free_keys_i(), free_sdbm(), free_values_i(), freeifaddrs(), freeobj_i(), getifaddrs(), ibf_dump_free(), ibf_loader_free(), Init_fiddle(), inst_free(), JSON_free(), mutex_free(), rb_fiddle_free(), rb_free_tmp_buffer(), rb_iseq_free(), rb_str_resize(), rb_thread_recycle_stack_release(), State_free(), strscan_free(), and thread_free().
void* ruby_xmalloc | ( | size_t | size | ) |
Definition at line 7931 of file gc.c.
References objspace_xmalloc().
Referenced by bt_init(), compile_array_keyword_arg(), dln_load(), getifaddrs(), ibf_load_alloc(), ibf_load_ci_entries(), iseq_set_sequence(), make_unique_str(), newobj_i(), rb_fiddle_malloc(), and rb_fiddle_ptr_malloc().
|
static |
Definition at line 7925 of file gc.c.
References objspace_xmalloc0().
Referenced by rb_alloc_tmp_buffer_with_count().
void* ruby_xmalloc2 | ( | size_t | n, |
size_t | size | ||
) |
Definition at line 7945 of file gc.c.
References objspace_xmalloc2().
Referenced by wmap_aset_update().
void* ruby_xrealloc | ( | void * | ptr, |
size_t | new_size | ||
) |
Definition at line 7981 of file gc.c.
References ruby_sized_xrealloc().
Referenced by rb_fiddle_realloc().
void* ruby_xrealloc2 | ( | void * | ptr, |
size_t | n, | ||
size_t | size | ||
) |
Definition at line 8000 of file gc.c.
References ruby_sized_xrealloc2().
|
static |
Definition at line 2762 of file gc.c.
References finalizer_table, key, run_finalizer(), RZOMBIE, st_data_t, st_delete, and code_page_table::table.
Referenced by finalize_list().
|
static |
Definition at line 2724 of file gc.c.
References rb_thread_struct::cfp, GET_THREAD, nonspecial_obj_id, RARRAY_AREF, RARRAY_LEN, rb_errinfo(), rb_safe_level(), RESTORE_FINALIZER, run_single_final(), TH_EXEC_TAG, TH_POP_TAG, and TH_PUSH_TAG.
Referenced by rb_objspace_call_finalizer(), and run_final().
Definition at line 2713 of file gc.c.
References FIX2INT, level, OBJ_TAINTED, RARRAY_AREF, rb_check_funcall(), rb_set_safe_level_force(), and RUBY_SAFE_LEVEL_MAX.
Referenced by run_finalizer().
|
inlinestatic |
Definition at line 1194 of file gc.c.
References check_rvalue_consistency(), RBasic::flags, obj_info(), rb_bug(), RBASIC, RGENGC_CHECK_MODE, RVALUE_FLAGS_AGE(), RVALUE_FLAGS_AGE_SET(), RVALUE_OLD_AGE, and RVALUE_OLD_UNCOLLECTIBLE_SET().
Referenced by gc_aging().
|
inlinestatic |
Definition at line 1270 of file gc.c.
References assert, check_rvalue_consistency(), RGENGC_CHECK_MODE, RVALUE_AGE_RESET_RAW(), and RVALUE_OLD_P().
Referenced by rb_gc_writebarrier_unprotect().
|
inlinestatic |
Definition at line 1264 of file gc.c.
References RBasic::flags, RBASIC, and RVALUE_FLAGS_AGE_SET().
Referenced by rb_copy_wb_protected_attribute(), and RVALUE_AGE_RESET().
|
inlinestatic |
Definition at line 1227 of file gc.c.
References assert, check_rvalue_consistency(), RBasic::flags, RBASIC, RGENGC_CHECK_MODE, RVALUE_FLAGS_AGE_SET(), RVALUE_OLD_AGE, and RVALUE_OLD_P().
Referenced by rgengc_check_relation().
|
inlinestatic |
Definition at line 1214 of file gc.c.
References assert, check_rvalue_consistency(), RBasic::flags, RBASIC, RGENGC_CHECK_MODE, RVALUE_FLAGS_AGE_SET(), RVALUE_OLD_AGE, RVALUE_OLD_P(), and RVALUE_OLD_UNCOLLECTIBLE_SET().
Referenced by gc_writebarrier_generational(), gc_writebarrier_incremental(), newobj_init(), and rgengc_check_relation().
|
inlinestatic |
Definition at line 1279 of file gc.c.
References RVALUE_MARKED(), and RVALUE_MARKING().
Referenced by gc_writebarrier_incremental(), rb_gc_writebarrier_remember(), and verify_internal_consistency_i().
|
inlinestatic |
Definition at line 1245 of file gc.c.
References assert, check_rvalue_consistency(), CLEAR_IN_BITMAP, GET_HEAP_MARKING_BITS, is_incremental_marking, rb_objspace::old_objects, rb_objspace::rgengc, RGENGC_CHECK_MODE, RVALUE_DEMOTE_RAW(), RVALUE_MARKED(), RVALUE_OLD_P(), and RVALUE_REMEMBERED().
Referenced by rb_copy_wb_protected_attribute(), and rb_gc_writebarrier_unprotect().
|
inlinestatic |
Definition at line 1238 of file gc.c.
References CLEAR_IN_BITMAP, RBasic::flags, GET_HEAP_UNCOLLECTIBLE_BITS, RBASIC, and RVALUE_FLAGS_AGE_SET().
Referenced by RVALUE_DEMOTE().
|
inlinestatic |
Definition at line 1034 of file gc.c.
References FL_PROMOTED0, FL_PROMOTED1, and RVALUE_AGE_SHIFT.
Referenced by check_rvalue_consistency(), rb_raw_obj_info(), RVALUE_AGE_INC(), and RVALUE_OLD_P().
Definition at line 1185 of file gc.c.
References FL_PROMOTED0, FL_PROMOTED1, RBasic::flags, and RVALUE_AGE_SHIFT.
Referenced by RVALUE_AGE_INC(), RVALUE_AGE_RESET_RAW(), RVALUE_AGE_SET_CANDIDATE(), RVALUE_AGE_SET_OLD(), and RVALUE_DEMOTE_RAW().
|
inlinestatic |
Definition at line 1108 of file gc.c.
References check_rvalue_consistency(), and RVALUE_MARK_BITMAP.
Referenced by gc_grey(), gc_mark_set(), gc_mark_stacked_objects(), gc_marks_wb_unprotected_objects(), newobj_init(), obj_free(), rb_gc_force_recycle(), rb_objspace_marked_object_p(), rgengc_check_relation(), RVALUE_BLACK_P(), RVALUE_DEMOTE(), and RVALUE_WHITE_P().
|
inlinestatic |
Definition at line 1123 of file gc.c.
References check_rvalue_consistency(), and RVALUE_MARKING_BITMAP.
Referenced by gc_aging(), gc_grey(), gc_mark_stacked_objects(), newobj_init(), obj_free(), rgengc_check_relation(), and RVALUE_BLACK_P().
|
inlinestatic |
Definition at line 1151 of file gc.c.
References check_rvalue_consistency(), RBasic::flags, RBASIC, RVALUE_FLAGS_AGE(), and RVALUE_OLD_P_RAW().
Referenced by check_generation_i(), gc_aging(), gc_mark_set_parent(), gc_page_sweep(), gc_writebarrier_generational(), gc_writebarrier_incremental(), newobj_init(), rb_copy_wb_protected_attribute(), rb_gc_force_recycle(), rb_gc_writebarrier(), rb_gc_writebarrier_remember(), rb_gc_writebarrier_unprotect(), rb_obj_gc_flags(), rb_obj_info_dump(), rgengc_check_relation(), rgengc_rememberset_mark(), RVALUE_AGE_RESET(), RVALUE_AGE_SET_CANDIDATE(), RVALUE_AGE_SET_OLD(), RVALUE_DEMOTE(), and verify_internal_consistency_i().
|
inlinestatic |
Definition at line 1144 of file gc.c.
References FL_PROMOTED0, FL_PROMOTED1, RBasic::flags, and RBASIC.
Referenced by RVALUE_OLD_P().
|
inlinestatic |
Definition at line 1179 of file gc.c.
References GET_HEAP_PAGE, and RVALUE_PAGE_OLD_UNCOLLECTIBLE_SET().
Referenced by RVALUE_AGE_INC(), and RVALUE_AGE_SET_OLD().
|
inlinestatic |
Definition at line 1167 of file gc.c.
References BUILTIN_TYPE, MARK_IN_BITMAP, rb_objspace::old_objects, rb_objspace::profile, rb_objspace::rgengc, and heap_page::uncollectible_bits.
Referenced by gc_aging(), and RVALUE_OLD_UNCOLLECTIBLE_SET().
|
inlinestatic |
Definition at line 1130 of file gc.c.
References check_rvalue_consistency(), and RVALUE_MARKING_BITMAP.
Referenced by check_generation_i(), rb_obj_info_dump(), rgengc_remembersetbits_get(), and RVALUE_DEMOTE().
|
inlinestatic |
Definition at line 1137 of file gc.c.
References check_rvalue_consistency(), and RVALUE_UNCOLLECTIBLE_BITMAP.
Referenced by check_generation_i(), obj_free(), rb_obj_gc_flags(), rgengc_rememberset_mark(), and verify_internal_consistency_i().
|
inlinestatic |
Definition at line 1116 of file gc.c.
References check_rvalue_consistency(), and RVALUE_WB_UNPROTECTED_BITMAP.
Referenced by check_color_i(), gc_marks_wb_unprotected_objects(), gc_writebarrier_generational(), gc_writebarrier_incremental(), newobj_init(), obj_free(), rb_copy_wb_protected_attribute(), rb_gc_unprotect_logging(), rb_gc_writebarrier_unprotect(), rb_obj_gc_flags(), rb_obj_info_dump(), rb_obj_rgengc_writebarrier_protected_p(), rgengc_check_relation(), rgengc_remember(), rgengc_rememberset_mark(), and verify_internal_consistency_i().
|
inlinestatic |
Definition at line 1293 of file gc.c.
References FALSE, and RVALUE_MARKED().
Referenced by check_color_i(), and gc_writebarrier_incremental().
Definition at line 3272 of file gc.c.
References hash(), INT2FIX, rb_hash_aset(), and ST_CONTINUE.
Referenced by count_objects().
|
static |
Definition at line 6910 of file gc.c.
References code_page_table::count, heap_allocatable_pages, heap_allocated_pages, heap_increment(), malloc_increase, malloc_limit, NEW_SYM, OLD_SYM, rb_gc_register_mark_object(), rb_hash_aset(), rb_hash_new(), rb_obj_freeze(), rb_obj_hide(), S, and code_page_table::table.
Referenced by gc_stat_internal().
|
static |
Definition at line 2606 of file gc.c.
References PRIsVALUE, rb_eArgError, rb_intern, rb_obj_class(), rb_obj_respond_to(), rb_raise(), and TRUE.
Referenced by define_final(), and rb_define_finalizer().
|
static |
Definition at line 2614 of file gc.c.
References FL_ABLE, rb_check_frozen, rb_eArgError, rb_obj_classname(), and rb_raise().
Referenced by define_final(), rb_define_finalizer(), and wmap_aset().
|
static |
Definition at line 3784 of file gc.c.
References mark_stack::cache, mark_stack::cache_size, free(), stack_chunk::next, and mark_stack::unused_cache_size.
Referenced by gc_mark_stacked_objects().
|
static |
Definition at line 3957 of file gc.c.
References GET_THREAD, rb_thread_struct::machine, SET_STACK_END, STACK_LENGTH, and STACK_LEVEL_MAX.
Referenced by ruby_stack_check().
|
static |
Definition at line 3745 of file gc.c.
References malloc, and rb_memerror().
Referenced by init_mark_stack(), and push_mark_stack_chunk().
Definition at line 9134 of file gc.c.
References rb_objspace_data_type_name(), T_ARRAY, T_BIGNUM, T_CLASS, T_COMPLEX, T_DATA, T_FALSE, T_FILE, T_FIXNUM, T_FLOAT, T_HASH, T_ICLASS, T_IMEMO, T_MATCH, T_MODULE, T_NIL, T_NODE, T_NONE, T_OBJECT, T_RATIONAL, T_REGEXP, T_STRING, T_STRUCT, T_SYMBOL, T_TRUE, T_UNDEF, T_ZOMBIE, and TYPE_NAME.
Referenced by obj_type_name(), and rb_during_gc().
|
static |
Definition at line 5083 of file gc.c.
References assert, BUILTIN_TYPE, check_children_i(), check_color_i(), check_generation_i(), is_incremental_marking, is_live_object(), is_marking, verify_internal_consistency_struct::live_object_count, verify_internal_consistency_struct::objspace, rb_objspace_reachable_objects_from(), RBASIC, RGENGC_CHECK_MODE, RVALUE_BLACK_P(), RVALUE_OLD_P(), RVALUE_UNCOLLECTIBLE(), RVALUE_WB_UNPROTECTED(), T_ZOMBIE, and verify_internal_consistency_struct::zombie_object_count.
Referenced by gc_verify_internal_consistency().
Definition at line 8213 of file gc.c.
References weakmap::final, ID2SYM, weakmap::obj2wmap, rb_intern, rb_obj_method(), st_init_numtable, TypedData_Make_Struct, and weakmap::wmap2obj.
Referenced by Init_GC().
Definition at line 8485 of file gc.c.
References is_id_value(), is_live_object(), Qnil, rb_objspace, st_data_t, st_lookup, TypedData_Get_Struct, and weakmap::wmap2obj.
Referenced by Init_GC(), and wmap_has_key().
Definition at line 8469 of file gc.c.
References define_final0(), weakmap::final, nonspecial_obj_id, weakmap::obj2wmap, should_be_finalizable(), st_data_t, st_insert, st_update(), TypedData_Get_Struct, weakmap::wmap2obj, and wmap_aset_update().
Referenced by Init_GC().
|
static |
Definition at line 8447 of file gc.c.
References ruby_sized_xrealloc2(), ruby_xmalloc2(), size, ST_CONTINUE, st_data_t, and ST_STOP.
Referenced by wmap_aset().
Definition at line 8336 of file gc.c.
References rb_objspace, st_data_t, st_foreach, TypedData_Get_Struct, weakmap::wmap2obj, and wmap_each_i().
Referenced by Init_GC().
Definition at line 8324 of file gc.c.
References is_id_value(), is_live_object(), rb_yield_values(), and ST_CONTINUE.
Referenced by wmap_each().
Definition at line 8359 of file gc.c.
References rb_objspace, st_data_t, st_foreach, TypedData_Get_Struct, weakmap::wmap2obj, and wmap_each_key_i().
Referenced by Init_GC().
Definition at line 8347 of file gc.c.
References is_id_value(), is_live_object(), rb_yield(), and ST_CONTINUE.
Referenced by wmap_each_key().
Definition at line 8382 of file gc.c.
References rb_objspace, st_data_t, st_foreach, TypedData_Get_Struct, weakmap::wmap2obj, and wmap_each_value_i().
Referenced by Init_GC().
Definition at line 8370 of file gc.c.
References is_id_value(), is_live_object(), rb_yield(), and ST_CONTINUE.
Referenced by wmap_each_value().
|
static |
Definition at line 8224 of file gc.c.
References ruby_sized_xfree(), ruby_sized_xrealloc2(), size, ST_CONTINUE, st_data_t, ST_DELETE, and ST_STOP.
Referenced by wmap_finalize().
Definition at line 8247 of file gc.c.
References NULL, weakmap::obj2wmap, obj_id_to_ref, ruby_sized_xfree(), size, st_data_t, st_delete, st_update(), TypedData_Get_Struct, weakmap::wmap2obj, and wmap_final_func().
Referenced by Init_GC().
|
static |
Definition at line 8174 of file gc.c.
References weakmap::obj2wmap, st_foreach, st_free_table, weakmap::wmap2obj, and wmap_free_map().
Definition at line 8166 of file gc.c.
References ruby_sized_xfree(), and ST_CONTINUE.
Referenced by wmap_free().
Definition at line 8307 of file gc.c.
References CLASS_OF, PRIsVALUE, rb_class_name(), rb_sprintf(), rb_str_cat2(), RSTRING_PTR, st_foreach, TypedData_Get_Struct, weakmap::wmap2obj, and wmap_inspect_i().
Referenced by Init_GC().
Definition at line 8283 of file gc.c.
References OBJ_INFECT, rb_any_to_s(), rb_inspect(), rb_str_append(), rb_str_cat2(), RSTRING_PTR, SPECIAL_CONST_P, ST_CONTINUE, and val.
Referenced by wmap_inspect().
Definition at line 8407 of file gc.c.
References wmap_iter_arg::objspace, rb_ary_new(), rb_objspace, st_data_t, st_foreach, TypedData_Get_Struct, wmap_iter_arg::value, weakmap::wmap2obj, and wmap_keys_i().
Referenced by Init_GC().
Definition at line 8393 of file gc.c.
References is_id_value(), is_live_object(), wmap_iter_arg::objspace, rb_ary_push(), ST_CONTINUE, and wmap_iter_arg::value.
Referenced by wmap_keys().
|
static |
Definition at line 8156 of file gc.c.
References weakmap::final, weakmap::obj2wmap, rb_gc_mark(), st_data_t, and st_foreach.
|
static |
Definition at line 8191 of file gc.c.
References weakmap::obj2wmap, size, st_data_t, st_foreach, st_memsize(), weakmap::wmap2obj, and wmap_memsize_map().
Definition at line 8508 of file gc.c.
References st_table::num_entries, TypedData_Get_Struct, ULONG2NUM, and weakmap::wmap2obj.
Referenced by Init_GC().
Definition at line 8434 of file gc.c.
References wmap_iter_arg::objspace, rb_ary_new(), rb_objspace, st_data_t, st_foreach, TypedData_Get_Struct, wmap_iter_arg::value, weakmap::wmap2obj, and wmap_values_i().
Referenced by Init_GC().
Definition at line 8420 of file gc.c.
References is_id_value(), is_live_object(), wmap_iter_arg::objspace, rb_ary_push(), ST_CONTINUE, and wmap_iter_arg::value.
Referenced by wmap_values().
Definition at line 7858 of file gc.c.
References rb_mul_size_overflow(), ruby_malloc_size_overflow(), and SSIZE_MAX.
Referenced by objspace_xcalloc(), and objspace_xmalloc2().
|
static |
|
static |
|
static |
volatile VALUE rb_gc_guarded_val |
Definition at line 94 of file gc.c.
Referenced by rb_gc_guarded_ptr_val().
VALUE* ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress |
Definition at line 720 of file gc.c.
Referenced by set_debug_option().
|
static |