Ruby
2.1.10p492(2016-04-01revision54464)
|
#include "ruby/ruby.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 "internal.h"
#include "gc.h"
#include "constant.h"
#include "ruby_atomic.h"
#include "probes.h"
#include <stdio.h>
#include <stdarg.h>
#include <setjmp.h>
#include <sys/types.h>
#include <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 | each_obj_args |
struct | os_each_struct |
struct | force_finalize_list |
struct | mark_tbl_arg |
struct | verify_internal_consistency_struct |
struct | objspace_and_reason |
struct | root_objects_data |
struct | weakmap |
struct | wmap_iter_arg |
Macros | |
#define | __has_feature(x) 0 |
#define | ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS |
#define | rb_setjmp(env) RUBY_SETJMP(env) |
#define | rb_jmp_buf rb_jmpbuf_t |
#define | GC_HEAP_FREE_SLOTS 4096 |
#define | GC_HEAP_INIT_SLOTS 10000 |
#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_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 | GC_DEBUG 0 |
#define | RGENGC_DEBUG 0 |
#define | RGENGC_CHECK_MODE 0 |
#define | RGENGC_PROFILE 0 |
#define | RGENGC_THREEGEN 0 |
#define | RGENGC_ESTIMATE_OLDMALLOC 1 |
#define | GC_PROFILE_MORE_DETAIL 0 |
#define | GC_PROFILE_DETAIL_MEMORY 0 |
#define | GC_ENABLE_LAZY_SWEEP 1 |
#define | CALC_EXACT_MALLOC_SIZE 0 |
#define | MALLOC_ALLOCATED_SIZE 0 |
#define | MALLOC_ALLOCATED_SIZE_CHECK 0 |
#define | STACK_CHUNK_SIZE 500 |
#define | HEAP_ALIGN_LOG 14 |
#define | CEILDIV(i, mod) (((i) + (mod) - 1)/(mod)) |
#define | GET_PAGE_BODY(x) ((struct heap_page_body *)((bits_t)(x) & ~(HEAP_ALIGN_MASK))) |
#define | GET_PAGE_HEADER(x) (&GET_PAGE_BODY(x)->header) |
#define | GET_HEAP_PAGE(x) (GET_PAGE_HEADER(x)->page) |
#define | GET_HEAP_MARK_BITS(x) (&GET_HEAP_PAGE(x)->mark_bits[0]) |
#define | GET_HEAP_REMEMBERSET_BITS(x) (&GET_HEAP_PAGE(x)->rememberset_bits[0]) |
#define | GET_HEAP_OLDGEN_BITS(x) (&GET_HEAP_PAGE(x)->oldgen_bits[0]) |
#define | NUM_IN_PAGE(p) (((bits_t)(p) & HEAP_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 | rb_objspace (*GET_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_pages_used objspace->heap_pages.used |
#define | heap_pages_length objspace->heap_pages.length |
#define | heap_pages_lomem objspace->heap_pages.range[0] |
#define | heap_pages_himem objspace->heap_pages.range[1] |
#define | heap_pages_swept_slots objspace->heap_pages.swept_slots |
#define | heap_pages_increment objspace->heap_pages.increment |
#define | heap_pages_min_free_slots objspace->heap_pages.min_free_slots |
#define | heap_pages_max_free_slots objspace->heap_pages.max_free_slots |
#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->flags.finalizing |
#define | finalizer_table objspace->finalizer_table |
#define | global_List objspace->global_list |
#define | ruby_gc_stress objspace->gc_stress |
#define | monitor_level objspace->rgengc.monitor_level |
#define | monitored_object_table objspace->rgengc.monitored_object_table |
#define | is_lazy_sweeping(heap) ((heap)->sweep_pages != 0) |
#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 | 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 | rgengc_report if (RGENGC_DEBUG) rgengc_report_body |
#define | FL_TEST2(x, f) ((RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) ? (rb_bug("FL_TEST2: SPECIAL_CONST"), 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_WB_PROTECTED_RAW(obj) FL_TEST2((obj), FL_WB_PROTECTED) |
#define | RVALUE_WB_PROTECTED(obj) RVALUE_WB_PROTECTED_RAW(check_gen_consistency((VALUE)obj)) |
#define | RVALUE_OLDGEN_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), (obj)) |
#define | gc_event_hook(objspace, event, data) |
#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 | rb_gc_mark_locations(start, end) gc_mark_locations(objspace, (start), (end)) |
#define | GET_STACK_BOUNDS(start, end, appendix) |
#define | STR_ASSOC FL_USER3 /* copied from string.c */ |
#define | RGENGC_PRINT_TICK 0 |
#define | MARK_CHECKPOINT_PRINT_TICK(category) |
#define | MARK_CHECKPOINT(category) |
#define | I(s) ID_##s = rb_intern(#s); |
#define | GC_NOTIFY 0 |
#define | S(s) sym_##s = ID2SYM(rb_intern_const(#s)) |
#define | SET(name, attr) |
#define | S(s) sym_##s = ID2SYM(rb_intern_const(#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 | TYPE_NAME(t) case (t): return #t; |
#define | OPT(o) if (o) rb_ary_push(opts, rb_str_new2(#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 *) |
Enumerations | |
enum | gc_profile_record_flag { GPR_FLAG_NONE = 0x000, GPR_FLAG_MAJOR_BY_NOFREE = 0x001, GPR_FLAG_MAJOR_BY_OLDGEN = 0x002, GPR_FLAG_MAJOR_BY_SHADY = 0x004, GPR_FLAG_MAJOR_BY_RESCAN = 0x008, GPR_FLAG_MAJOR_BY_STRESS = 0x010, GPR_FLAG_MAJOR_BY_OLDMALLOC = 0x020, GPR_FLAG_MAJOR_MASK = 0x0ff, GPR_FLAG_NEWOBJ = 0x100, GPR_FLAG_MALLOC = 0x200, GPR_FLAG_METHOD = 0x400, GPR_FLAG_CAPI = 0x800, GPR_FLAG_STRESS = 0x1000, GPR_FLAG_IMMEDIATE_SWEEP = 0x2000, GPR_FLAG_HAVE_FINALIZE = 0x4000 } |
enum | { BITS_SIZE = sizeof(bits_t), BITS_BITLENGTH = ( BITS_SIZE * CHAR_BIT ) } |
enum | { HEAP_ALIGN = (1UL << HEAP_ALIGN_LOG), HEAP_ALIGN_MASK = (~(~0UL << HEAP_ALIGN_LOG)), REQUIRED_SIZE_BY_MALLOC = (sizeof(size_t) * 5), HEAP_SIZE = (HEAP_ALIGN - REQUIRED_SIZE_BY_MALLOC), HEAP_OBJ_LIMIT = (unsigned int)((HEAP_SIZE - sizeof(struct heap_page_header))/sizeof(struct RVALUE)), HEAP_BITMAP_LIMIT = CEILDIV(CEILDIV(HEAP_SIZE, sizeof(struct RVALUE)), BITS_BITLENGTH), HEAP_BITMAP_SIZE = ( BITS_SIZE * HEAP_BITMAP_LIMIT), HEAP_BITMAP_PLANES = USE_RGENGC ? 3 : 1 } |
enum | memop_type { MEMOP_TYPE_MALLOC = 1, MEMOP_TYPE_FREE = 2, MEMOP_TYPE_REALLOC = 3 } |
Variables | |
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_stress = 0 |
int | ruby_stack_grow_direction |
static st_table * | rgengc_unprotect_logging_table |
static const rb_data_type_t | weakmap_type |
#define BITMAP_BIT | ( | p | ) | ((bits_t)1 << BITMAP_OFFSET(p)) |
Definition at line 591 of file gc.c.
Referenced by gc_page_sweep().
#define BITMAP_INDEX | ( | p | ) | (NUM_IN_PAGE(p) / BITS_BITLENGTH ) |
Definition at line 589 of file gc.c.
Referenced by gc_page_sweep().
#define BITMAP_OFFSET | ( | p | ) | (NUM_IN_PAGE(p) & (BITS_BITLENGTH-1)) |
#define CALC_EXACT_MALLOC_SIZE 0 |
Definition at line 247 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 595 of file gc.c.
Referenced by obj_free(), rb_gc_force_recycle(), rgengc_rememberset_mark(), and RVALUE_DEMOTE_FROM_OLD().
Referenced by count_objects().
#define dont_gc objspace->flags.dont_gc |
Definition at line 623 of file gc.c.
Referenced by garbage_collect_with_gvl(), heap_ready_to_gc(), newobj_of(), rb_gc_disable(), and rb_gc_enable().
#define during_gc objspace->flags.during_gc |
Definition at line 624 of file gc.c.
Referenced by garbage_collect(), garbage_collect_body(), gc_heap_prepare_minimum_pages(), gc_heap_rest_sweep(), heap_page_allocate(), heap_pages_expand_sorted(), heap_prepare_freepage(), heap_ready_to_gc(), newobj_of(), rb_during_gc(), rb_objspace_call_finalizer(), and rgengc_report_body().
#define finalizer_table objspace->finalizer_table |
Definition at line 626 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->flags.finalizing |
Definition at line 625 of file gc.c.
Referenced by gc_finalize_deferred(), gc_page_sweep(), gc_start_internal(), rb_gc(), 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) |
Definition at line 705 of file gc.c.
Referenced by RVALUE_PROMOTE_INFANT().
#define FL_TEST2 | ( | x, | |
f | |||
) | ((RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) ? (rb_bug("FL_TEST2: SPECIAL_CONST"), 0) : FL_TEST_RAW((x),(f)) != 0) |
Definition at line 704 of file gc.c.
Referenced by check_gen_consistency(), RVALUE_INFANT_P(), RVALUE_OLD_P(), and RVALUE_PROMOTED_P().
#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) |
Definition at line 706 of file gc.c.
Referenced by RVALUE_DEMOTE_FROM_OLD().
#define GC_ENABLE_LAZY_SWEEP 1 |
Definition at line 244 of file gc.c.
Referenced by garbage_collect_body(), heap_prepare_freepage(), and Init_GC().
#define gc_event_hook | ( | objspace, | |
event, | |||
data | |||
) |
Definition at line 1278 of file gc.c.
Referenced by garbage_collect_body(), gc_after_sweep(), gc_marks_body(), newobj_of(), and obj_free().
#define GC_NOTIFY 0 |
Definition at line 4970 of file gc.c.
Referenced by garbage_collect_body().
#define gc_prof_enabled | ( | objspace | ) | ((objspace)->profile.run && (objspace)->profile.current_record) |
Definition at line 691 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 690 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(), gc_prof_timer_stop(), and rgengc_rememberset_mark().
#define GC_PROFILE_DETAIL_MEMORY 0 |
Definition at line 241 of file gc.c.
Referenced by gc_profile_dump_on(), and Init_GC().
#define GC_PROFILE_MORE_DETAIL 0 |
Definition at line 238 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 6706 of file gc.c.
Referenced by gc_prof_setup_new_record(), and gc_profile_clear().
#define GET_HEAP_MARK_BITS | ( | x | ) | (&GET_HEAP_PAGE(x)->mark_bits[0]) |
Definition at line 585 of file gc.c.
Referenced by gc_mark_ptr(), gc_marked(), is_dead_object(), rb_gc_force_recycle(), and rb_obj_gc_flags().
#define GET_HEAP_OLDGEN_BITS | ( | x | ) | (&GET_HEAP_PAGE(x)->oldgen_bits[0]) |
Definition at line 587 of file gc.c.
Referenced by obj_free(), rb_gc_force_recycle(), RVALUE_DEMOTE_FROM_OLD(), and RVALUE_PROMOTE_INFANT().
#define GET_HEAP_PAGE | ( | x | ) | (GET_PAGE_HEADER(x)->page) |
Definition at line 584 of file gc.c.
Referenced by finalize_list(), heap_is_swept_object(), rb_gc_force_recycle(), and verify_internal_consistency_reachable_i().
#define GET_HEAP_REMEMBERSET_BITS | ( | x | ) | (&GET_HEAP_PAGE(x)->rememberset_bits[0]) |
Definition at line 586 of file gc.c.
Referenced by rb_gc_force_recycle(), rb_obj_gc_flags(), rgengc_remembersetbits_get(), and rgengc_remembersetbits_set().
#define GET_PAGE_BODY | ( | x | ) | ((struct heap_page_body *)((bits_t)(x) & ~(HEAP_ALIGN_MASK))) |
#define GET_PAGE_HEADER | ( | x | ) | (&GET_PAGE_BODY(x)->header) |
#define GET_STACK_BOUNDS | ( | start, | |
end, | |||
appendix | |||
) |
Definition at line 3472 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 627 of file gc.c.
Referenced by gc_mark_roots(), rb_gc_register_address(), rb_gc_unregister_address(), and rb_objspace_free().
#define heap_eden (&objspace->eden_heap) |
Definition at line 621 of file gc.c.
Referenced by gc_after_sweep(), gc_before_sweep(), gc_marks_body(), gc_rest_sweep(), gc_set_initial_pages(), gc_stat_internal(), gc_sweep(), heap_pages_expand_sorted(), Init_heap(), is_dead_object(), is_swept_object(), newobj_of(), objspace_malloc_increase(), objspace_total_slot(), rb_gc_resurrect(), and ready_to_gc().
#define heap_pages_deferred_final objspace->heap_pages.deferred_final |
Definition at line 620 of file gc.c.
Referenced by finalize_deferred(), gc_page_sweep(), gc_prof_sweep_timer_stop(), make_deferred(), and rb_objspace_call_finalizer().
#define heap_pages_final_slots objspace->heap_pages.final_slots |
Definition at line 619 of file gc.c.
Referenced by gc_page_sweep(), gc_stat_internal(), objspace_free_slot(), and run_final().
#define heap_pages_himem objspace->heap_pages.range[1] |
Definition at line 614 of file gc.c.
Referenced by heap_page_allocate(), is_pointer_to_heap(), and rb_objspace_free().
#define heap_pages_increment objspace->heap_pages.increment |
Definition at line 616 of file gc.c.
Referenced by gc_after_sweep(), gc_stat_internal(), heap_add_pages(), heap_increment(), heap_pages_expand_sorted(), and heap_set_increment().
#define heap_pages_length objspace->heap_pages.length |
Definition at line 612 of file gc.c.
Referenced by gc_stat_internal(), heap_increment(), heap_page_allocate(), heap_page_create(), heap_pages_expand_sorted(), heap_set_increment(), and rb_objspace_free().
#define heap_pages_lomem objspace->heap_pages.range[0] |
Definition at line 613 of file gc.c.
Referenced by heap_page_allocate(), and rb_objspace_free().
#define heap_pages_max_free_slots objspace->heap_pages.max_free_slots |
Definition at line 618 of file gc.c.
Referenced by gc_before_sweep(), and heap_pages_free_unused_pages().
#define heap_pages_min_free_slots objspace->heap_pages.min_free_slots |
Definition at line 617 of file gc.c.
Referenced by gc_after_sweep(), and gc_before_sweep().
#define heap_pages_sorted objspace->heap_pages.sorted |
Definition at line 610 of file gc.c.
Referenced by count_objects(), heap_page_allocate(), heap_pages_expand_sorted(), heap_pages_free_unused_pages(), is_pointer_to_heap(), objspace_each_objects(), rb_objspace_call_finalizer(), and rb_objspace_free().
#define heap_pages_swept_slots objspace->heap_pages.swept_slots |
Definition at line 615 of file gc.c.
Referenced by finalize_list(), gc_after_sweep(), gc_before_sweep(), gc_page_sweep(), gc_stat_internal(), and heap_pages_free_unused_pages().
#define heap_pages_used objspace->heap_pages.used |
Definition at line 611 of file gc.c.
Referenced by count_objects(), garbage_collect(), garbage_collect_body(), gc_stat_internal(), 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(), and rb_objspace_free().
#define heap_tomb (&objspace->tomb_heap) |
Definition at line 622 of file gc.c.
Referenced by gc_after_sweep(), gc_page_sweep(), gc_stat_internal(), heap_page_create(), heap_page_resurrect(), heap_pages_expand_sorted(), heap_pages_free_unused_pages(), heap_set_increment(), and objspace_total_slot().
#define I | ( | s | ) | ID_##s = rb_intern(#s); |
Referenced by rb_obj_gc_flags().
#define is_lazy_sweeping | ( | heap | ) | ((heap)->sweep_pages != 0) |
Definition at line 632 of file gc.c.
Referenced by gc_heap_rest_sweep(), heap_prepare_freepage(), is_dead_object(), objspace_malloc_increase(), and rb_gc_resurrect().
#define malloc_allocated_size objspace->malloc_params.allocated_size |
Definition at line 609 of file gc.c.
Referenced by gc_prof_setup_new_record().
#define malloc_increase objspace->malloc_params.increase |
Definition at line 608 of file gc.c.
Referenced by gc_before_sweep(), gc_prof_set_malloc_info(), gc_stat_internal(), and objspace_malloc_increase().
#define malloc_limit objspace->malloc_params.limit |
Definition at line 607 of file gc.c.
Referenced by gc_before_sweep(), gc_prof_set_malloc_info(), gc_stat_internal(), objspace_malloc_increase(), and rb_objspace_alloc().
#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 594 of file gc.c.
Referenced by gc_mark_ptr(), rgengc_remembersetbits_set(), and RVALUE_PROMOTE_INFANT().
#define MARKED_IN_BITMAP | ( | bits, | |
p | |||
) | ((bits)[BITMAP_INDEX(p)] & BITMAP_BIT(p)) |
Definition at line 593 of file gc.c.
Referenced by gc_marked(), is_dead_object(), obj_free(), rb_obj_gc_flags(), rgengc_remembersetbits_get(), rgengc_remembersetbits_set(), and verify_internal_consistency_reachable_i().
#define monitored_object_table objspace->rgengc.monitored_object_table |
#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory] |
Definition at line 646 of file gc.c.
Referenced by Init_GC(), and rb_memerror().
#define nonspecial_obj_id | ( | obj | ) | (VALUE)((SIGNED_VALUE)(obj)|FIXNUM_FLAG) |
Definition at line 634 of file gc.c.
Referenced by rb_obj_id(), run_finalizer(), and wmap_aset().
#define NUM_IN_PAGE | ( | p | ) | (((bits_t)(p) & HEAP_ALIGN_MASK)/sizeof(RVALUE)) |
Definition at line 588 of file gc.c.
Referenced by gc_page_sweep(), and rgengc_rememberset_mark().
#define obj_id_to_ref | ( | objid | ) | ((objid) ^ FIXNUM_FLAG) /* unset FIXNUM_FLAG */ |
Definition at line 635 of file gc.c.
Referenced by id2ref(), and wmap_finalize().
#define OPT | ( | o | ) | if (o) rb_ary_push(opts, rb_str_new2(#o)) |
Referenced by Init_GC().
#define RANY | ( | o | ) | ((RVALUE*)(o)) |
Definition at line 644 of file gc.c.
Referenced by gc_mark_children(), is_pointer_to_heap(), newobj_of(), obj_free(), and rb_objspace_call_finalizer().
#define rb_gc_mark_locations | ( | start, | |
end | |||
) | gc_mark_locations(objspace, (start), (end)) |
Definition at line 3319 of file gc.c.
Referenced by cont_mark(), env_mark(), mark_current_machine_context(), name_err_mesg_mark(), rb_gc_mark_machine_stack(), rb_gc_mark_symbols(), rb_thread_mark(), and rb_vm_mark().
#define rb_jmp_buf rb_jmpbuf_t |
Definition at line 89 of file gc.c.
Referenced by mark_current_machine_context().
#define rb_objspace (*GET_VM()->objspace) |
Definition at line 599 of file gc.c.
Referenced by check_gen_consistency(), count_objects(), define_final0(), gc_finalize_deferred(), 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(), gc_verify_internal_consistency(), id2ref(), Init_heap(), lazy_sweep_enable(), newobj_of(), objspace_each_objects(), rb_during_gc(), rb_gc(), rb_gc_copy_finalizer(), rb_gc_disable(), rb_gc_enable(), rb_gc_force_recycle(), rb_gc_latest_gc_info(), rb_gc_mark_machine_stack(), rb_gc_register_address(), rb_gc_resurrect(), rb_gc_unregister_address(), rb_gc_writebarrier(), rb_gc_writebarrier_remember_promoted(), rb_gc_writebarrier_unprotect_promoted(), rb_objspace_each_objects(), 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(), RVALUE_PROMOTE_INFANT(), wmap_aref(), wmap_each(), wmap_each_key(), wmap_each_value(), wmap_keys(), and wmap_values().
Definition at line 88 of file gc.c.
Referenced by mark_current_machine_context().
#define RGENGC_CHECK_MODE 0 |
Definition at line 196 of file gc.c.
Referenced by check_gen_consistency(), gc_mark_stacked_objects(), Init_GC(), is_markable_object(), rb_gc_writebarrier(), rb_gc_writebarrier_unprotect_promoted(), RVALUE_DEMOTE_FROM_OLD(), and RVALUE_PROMOTE_INFANT().
#define RGENGC_DEBUG 0 |
Definition at line 185 of file gc.c.
Referenced by Init_GC(), and rgengc_report_body().
#define RGENGC_PROFILE 0 |
Definition at line 205 of file gc.c.
Referenced by gc_profile_dump_on(), Init_GC(), and rgengc_remember().
#define rgengc_report if (RGENGC_DEBUG) rgengc_report_body |
Definition at line 693 of file gc.c.
Referenced by gc_after_sweep(), gc_before_sweep(), gc_mark_children(), gc_marks_body(), gc_page_sweep(), heap_increment(), heap_page_add_freeobj(), heap_page_allocate(), heap_pages_expand_sorted(), newobj_of(), rb_gc_writebarrier(), rb_gc_writebarrier_unprotect_promoted(), rgengc_remember(), rgengc_remembered(), and rgengc_rememberset_mark().
#define RGENGC_THREEGEN 0 |
Definition at line 214 of file gc.c.
Referenced by gc_after_sweep(), and Init_GC().
#define ruby_gc_stress objspace->gc_stress |
Definition at line 628 of file gc.c.
Referenced by garbage_collect_body(), gc_prof_setup_new_record(), gc_stress_get(), gc_stress_set(), newobj_of(), objspace_malloc_increase(), and rb_objspace_alloc().
#define ruby_initial_gc_stress gc_params.gc_stress |
Definition at line 600 of file gc.c.
Referenced by rb_objspace_alloc().
#define RVALUE_OLDGEN_BITMAP | ( | obj | ) | MARKED_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), (obj)) |
Definition at line 711 of file gc.c.
Referenced by check_gen_consistency(), and RVALUE_OLD_BITMAP_P().
#define RVALUE_WB_PROTECTED | ( | obj | ) | RVALUE_WB_PROTECTED_RAW(check_gen_consistency((VALUE)obj)) |
Definition at line 709 of file gc.c.
Referenced by gc_mark_children(), rb_gc_writebarrier_unprotect_promoted(), rgengc_check_relation(), rgengc_remember(), and rgengc_rememberset_mark().
#define RVALUE_WB_PROTECTED_RAW | ( | obj | ) | FL_TEST2((obj), FL_WB_PROTECTED) |
Definition at line 708 of file gc.c.
Referenced by check_gen_consistency().
#define S | ( | s | ) | sym_##s = ID2SYM(rb_intern_const(#s)) |
Referenced by gc_info_decode(), gc_stat_internal(), quorem(), and ruby_dtoa().
#define S | ( | s | ) | sym_##s = ID2SYM(rb_intern_const(#s)) |
#define SET | ( | name, | |
attr | |||
) |
Referenced by gc_info_decode(), and gc_stat_internal().
#define SET_STACK_END SET_MACHINE_STACK_END(&th->machine.stack_end) |
Definition at line 3224 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 391 of file gc.c.
Referenced by init_mark_stack().
#define STACK_END (th->machine.stack_end) |
Definition at line 3228 of file gc.c.
Referenced by mark_current_machine_context(), and ruby_stack_length().
#define STACK_LENGTH |
Definition at line 3229 of file gc.c.
Referenced by stack_check().
#define STACK_START (th->machine.stack_start) |
Definition at line 3227 of file gc.c.
Referenced by mark_current_machine_context(), and ruby_stack_length().
#define STACKFRAME_FOR_CALL_CFUNC 512 |
Definition at line 3279 of file gc.c.
Referenced by ruby_stack_check().
#define STR_ASSOC FL_USER3 /* copied from string.c */ |
Referenced by rb_str_associate(), rb_str_new_frozen(), str_buf_cat(), and str_replace().
#define TRY_WITH_GC | ( | alloc | ) |
Definition at line 6083 of file gc.c.
Referenced by objspace_xcalloc(), objspace_xmalloc(), and objspace_xrealloc().
Referenced by type_name().
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 |
enum memop_type |
|
static |
Definition at line 3111 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 5939 of file gc.c.
References free().
Referenced by heap_page_allocate(), and heap_page_free().
|
static |
|
inlinestatic |
Definition at line 5969 of file gc.c.
References ATOMIC_SIZE_CAS, sub, and val.
Referenced by objspace_malloc_increase().
Definition at line 717 of file gc.c.
References rb_objspace::during_minor_gc, FALSE, FL_PROMOTED, FL_TEST2, gc_marked(), is_pointer_to_heap(), obj_memsize_of(), obj_type_name(), rb_bug(), rb_objspace, rb_objspace::rgengc, RGENGC_CHECK_MODE, RVALUE_OLDGEN_BITMAP, RVALUE_WB_PROTECTED_RAW, and type.
Referenced by gc_mark_children(), rgengc_remembered(), RVALUE_DEMOTE_FROM_OLD(), RVALUE_INFANT_P(), RVALUE_OLD_BITMAP_P(), RVALUE_OLD_P(), RVALUE_PROMOTE_INFANT(), and RVALUE_PROMOTED_P().
Definition at line 2591 of file gc.c.
References argc, argv, RVALUE::as, RVALUE::basic, BUILTIN_TYPE, COUNT_TYPE, RBasic::flags, hash(), heap_pages_sorted, heap_pages_used, ID2SYM, INT2NUM, heap_page::limit, 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_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 type.
Referenced by Init_GC().
Definition at line 1949 of file gc.c.
References argc, argv, define_final0(), rb_block_proc(), rb_scan_args(), should_be_callable(), and should_be_finalizable().
Referenced by Init_GC().
Definition at line 1966 of file gc.c.
References finalizer_table, FL_FINALIZE, INT2FIX, OBJ_FREEZE, rb_ary_new3, rb_ary_push(), rb_objspace, rb_safe_level, RBASIC, RBASIC_CLEAR_CLASS, st_add_direct(), st_data_t, and st_lookup().
Referenced by define_final(), rb_define_finalizer(), and wmap_aset().
|
static |
Definition at line 6820 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 2092 of file gc.c.
References ATOMIC_PTR_EXCHANGE, finalize_list(), and heap_pages_deferred_final.
Referenced by gc_finalize_deferred(), gc_start_internal(), rb_gc(), and rb_objspace_call_finalizer().
|
static |
Definition at line 2074 of file gc.c.
References RVALUE::as, heap_page::final_slots, RVALUE::free, GET_HEAP_PAGE, heap_page_add_freeobj(), heap_pages_swept_slots, rb_objspace::profile, run_final(), and rb_objspace::total_freed_object_num.
Referenced by finalize_deferred(), and rb_objspace_call_finalizer().
Definition at line 2132 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 1459 of file gc.c.
References ST_CONTINUE, and xfree().
Referenced by rb_free_const_table().
|
static |
Definition at line 1434 of file gc.c.
References rb_method_entry_struct::mark, rb_free_method_entry(), and ST_CONTINUE.
Referenced by rb_free_m_tbl().
|
static |
Definition at line 3167 of file gc.c.
References mark_stack::chunk, free(), stack_chunk::next, heap_page::next, and NULL.
Referenced by rb_objspace_free().
|
static |
Definition at line 5056 of file gc.c.
References during_gc, FALSE, garbage_collect_body(), gc_rest_sweep(), getrusage_time(), heap_pages_used, rb_objspace::profile, ready_to_gc(), and TRUE.
Referenced by garbage_collect_with_gvl(), gc_start_internal(), gc_with_gvl(), heap_prepare_freepage(), newobj_of(), rb_garbage_collect(), and rb_gc().
|
static |
Definition at line 4973 of file gc.c.
References rb_objspace::count, rb_objspace::dont_lazy_sweep, during_gc, FALSE, FIX2INT, FIXNUM_P, rb_objspace::flags, GC_ENABLE_LAZY_SWEEP, gc_event_hook, gc_marks(), GC_NOTIFY, gc_prof_setup_new_record(), gc_prof_timer_start(), gc_prof_timer_stop(), gc_sweep(), GPR_FLAG_IMMEDIATE_SWEEP, GPR_FLAG_MAJOR_BY_NOFREE, GPR_FLAG_MAJOR_BY_OLDGEN, GPR_FLAG_MAJOR_BY_SHADY, GPR_FLAG_MAJOR_BY_STRESS, GPR_FLAG_MAJOR_MASK, GPR_FLAG_NONE, heap_pages_used, rb_objspace::heap_used_at_gc_start, rb_objspace::latest_gc_info, rb_objspace::need_major_gc, rb_objspace::old_object_count, rb_objspace::old_object_limit, rb_objspace::profile, rb_bug(), rb_objspace::remembered_shady_object_count, rb_objspace::remembered_shady_object_limit, rb_objspace::rgengc, ruby_disable_gc_stress, ruby_gc_stress, RUBY_INTERNAL_EVENT_GC_START, rb_objspace::total_allocated_object_num, rb_objspace::total_allocated_object_num_at_gc_start, and TRUE.
Referenced by garbage_collect(), and heap_prepare_freepage().
|
static |
Definition at line 5095 of file gc.c.
References dont_gc, EXIT_FAILURE, objspace_and_reason::full_mark, garbage_collect(), gc_with_gvl(), 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_increase().
|
static |
Definition at line 2955 of file gc.c.
References rb_objspace::count, rb_objspace::during_minor_gc, gc_event_hook, gc_prof_set_heap_info(), GPR_FLAG_MAJOR_BY_NOFREE, heap_page::heap, heap_eden, heap_increment(), HEAP_OBJ_LIMIT, heap_pages_free_unused_pages(), heap_pages_increment, heap_pages_min_free_slots, heap_pages_swept_slots, heap_set_increment(), heap_tomb, rb_objspace::last_major_gc, rb_objspace::major_gc_count, rb_objspace::minor_gc_count, rb_objspace::need_major_gc, rb_objspace::profile, rb_gc_count(), rb_objspace::remembered_shady_object_count, rb_objspace::rgengc, rgengc_report, RGENGC_THREEGEN, RUBY_INTERNAL_EVENT_GC_END_SWEEP, and rb_heap_struct::total_slots.
Referenced by gc_heap_lazy_sweep().
|
static |
Definition at line 2833 of file gc.c.
References RVALUE::as, RVALUE::free, rb_heap_struct::free_pages, rb_heap_struct::freelist, heap_page::freelist, heap_page::heap, NULL, rb_heap_struct::pages, rb_heap_struct::sweep_pages, and rb_heap_struct::using_page.
Referenced by gc_before_sweep().
|
static |
Definition at line 2853 of file gc.c.
References ATOMIC_SIZE_EXCHANGE, rb_objspace::during_minor_gc, gc_before_heap_sweep(), gc_params, gc_prof_set_malloc_info(), GET_VM, GPR_FLAG_MAJOR_BY_OLDMALLOC, heap_page::heap, heap_eden, ruby_gc_params_t::heap_free_slots, ruby_gc_params_t::heap_init_slots, heap_pages_max_free_slots, heap_pages_min_free_slots, heap_pages_swept_slots, 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, objspace_total_slot(), 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(), rb_sweep_method_entry(), rb_objspace::rgengc, and rgengc_report.
Referenced by gc_sweep().
Definition at line 5238 of file gc.c.
References rb_gc_count(), and SIZET2NUM.
Referenced by Init_GC().
|
static |
Definition at line 1272 of file gc.c.
References rb_thread_struct::cfp, EXEC_EVENT_HOOK, GET_THREAD(), and rb_control_frame_struct::self.
|
static |
Definition at line 2102 of file gc.c.
References ATOMIC_EXCHANGE, ATOMIC_SET, finalize_deferred(), finalizing, and rb_objspace.
Referenced by gc_finalize_deferred_register(), and rb_gc_finalize_deferred().
|
static |
Definition at line 2118 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 3007 of file gc.c.
References FALSE, rb_heap_struct::free_pages, gc_after_sweep(), gc_page_sweep(), gc_prof_sweep_timer_start(), gc_prof_sweep_timer_stop(), heap_page::heap, heap_page::next, NULL, result, rb_heap_struct::sweep_pages, and TRUE.
Referenced by gc_heap_rest_sweep(), gc_sweep(), and heap_prepare_freepage().
|
static |
Definition at line 2820 of file gc.c.
References during_gc, rb_heap_struct::free_pages, heap_page::heap, heap_increment(), heap_set_increment(), and rb_memerror().
Referenced by gc_sweep().
|
static |
Definition at line 3041 of file gc.c.
References during_gc, gc_heap_lazy_sweep(), heap_page::heap, and is_lazy_sweeping.
Referenced by gc_rest_sweep(), and gc_sweep().
Definition at line 5244 of file gc.c.
References GPR_FLAG_CAPI, GPR_FLAG_HAVE_FINALIZE, GPR_FLAG_IMMEDIATE_SWEEP, GPR_FLAG_MAJOR_BY_NOFREE, GPR_FLAG_MAJOR_BY_OLDGEN, GPR_FLAG_MAJOR_BY_OLDMALLOC, GPR_FLAG_MAJOR_BY_RESCAN, GPR_FLAG_MAJOR_BY_SHADY, GPR_FLAG_MAJOR_BY_STRESS, GPR_FLAG_MALLOC, GPR_FLAG_METHOD, GPR_FLAG_NEWOBJ, GPR_FLAG_STRESS, hash(), objspace_and_reason::immediate_sweep, key, malloc, Qfalse, Qnil, Qtrue, rb_eArgError, rb_eTypeError, rb_id2str(), rb_raise(), RB_TYPE_P, RSTRING_PTR, S, SET, SYM2ID, SYMBOL_P, and T_HASH.
Referenced by gc_latest_gc_info(), gc_profile_record_get(), and rb_gc_latest_gc_info().
Definition at line 5337 of file gc.c.
References argc, argv, gc_info_decode(), rb_objspace::latest_gc_info, objspace_and_reason::objspace, rb_objspace::profile, 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().
|
static |
Definition at line 3592 of file gc.c.
References rb_objspace::mark_func_data_struct::data, gc_mark_ptr(), is_markable_object(), LIKELY, rb_objspace::mark_func_data_struct::mark_func, rb_objspace::mark_func_data, rb_objspace::mark_stack, push_mark_stack(), and rgengc_check_relation().
Referenced by gc_mark_children(), gc_mark_maybe(), mark_const_entry_i(), mark_entry(), mark_key(), mark_keyvalue(), mark_method_entry(), and rb_gc_mark().
|
static |
Definition at line 3627 of file gc.c.
References BUILTIN_TYPE, check_gen_consistency(), rb_objspace::during_minor_gc, FALSE, FL_EXIVAR, FL_TEST, gc_mark(), gc_mark_maybe(), gc_mark_ptr(), if(), is_markable_object(), LIKELY, rb_objspace::mark_func_data, mark_locations_array(), nd_type, NODE_ALIAS, NODE_ALLOCA, NODE_AND, NODE_ARGS, NODE_ARGS_AUX, NODE_ARGSCAT, NODE_ARRAY, NODE_BACK_REF, NODE_BLOCK, NODE_BLOCK_ARG, NODE_BLOCK_PASS, NODE_BREAK, NODE_CALL, NODE_CASE, NODE_CDECL, NODE_CLASS, NODE_COLON2, NODE_COLON3, NODE_CREF, NODE_CVAR, NODE_CVASGN, NODE_DASGN, NODE_DASGN_CURR, NODE_DEFINED, NODE_DEFN, NODE_DEFS, NODE_DOT2, NODE_DOT3, NODE_DREGX, NODE_DREGX_ONCE, NODE_DSTR, NODE_DVAR, NODE_DXSTR, NODE_ENSURE, NODE_ERRINFO, NODE_EVSTR, NODE_FALSE, NODE_FCALL, NODE_FLIP2, NODE_FLIP3, NODE_FOR, NODE_GASGN, NODE_GVAR, NODE_HASH, NODE_IASGN, NODE_IASGN2, NODE_IF, NODE_ITER, NODE_IVAR, NODE_LASGN, NODE_LIT, NODE_LVAR, NODE_MASGN, NODE_MATCH, NODE_MATCH2, NODE_MATCH3, NODE_MODULE, NODE_NEXT, NODE_NIL, NODE_NTH_REF, NODE_OP_ASGN1, NODE_OP_ASGN_AND, NODE_OP_ASGN_OR, NODE_OPT_ARG, NODE_OPT_N, NODE_OR, NODE_POSTEXE, NODE_REDO, NODE_RESBODY, NODE_RESCUE, NODE_RETRY, NODE_RETURN, NODE_SCLASS, NODE_SCOPE, NODE_SELF, NODE_SPLAT, NODE_STR, NODE_SUPER, NODE_TO_ARY, NODE_TRUE, NODE_UNDEF, NODE_UNTIL, NODE_VALIAS, NODE_VCALL, NODE_WHEN, NODE_WHILE, NODE_XSTR, NODE_YIELD, NODE_ZARRAY, NODE_ZSUPER, obj_type_name(), rb_objspace::old_object_count, rb_objspace::parent_object_is_old, RANY, rb_bug(), rb_mark_generic_ivar(), rb_objspace::rgengc, rgengc_check_relation(), rgengc_report, RVALUE_INFANT_P(), RVALUE_PROMOTE_INFANT(), RVALUE_WB_PROTECTED, T_FIXNUM, T_NIL, T_NODE, and TRUE.
Referenced by gc_mark_stacked_objects(), rb_objspace_reachable_objects_from(), and rgengc_rememberset_mark().
|
static |
Definition at line 3304 of file gc.c.
References mark_locations_array(), and heap_page::start.
Referenced by rb_gc_mark_locations().
|
static |
Definition at line 3528 of file gc.c.
References BUILTIN_TYPE, gc_mark(), is_pointer_to_heap(), T_NONE, T_ZOMBIE, type, and VALGRIND_MAKE_MEM_DEFINED.
Referenced by gc_mark_children(), mark_locations_array(), and rb_gc_mark_maybe().
|
inlinestatic |
Definition at line 3554 of file gc.c.
References gc_marked(), GET_HEAP_MARK_BITS, and MARK_IN_BITMAP.
Referenced by gc_mark(), gc_mark_children(), rb_gc_resurrect(), and rgengc_rememberset_mark().
|
static |
Definition at line 4061 of file gc.c.
References FALSE, finalizer_table, GET_THREAD(), global_List, list, MARK_CHECKPOINT, mark_current_machine_context(), mark_tbl(), rb_objspace::parent_object_is_old, rb_gc_mark(), rb_gc_mark_encodings(), rb_gc_mark_global_tbl(), rb_gc_mark_maybe(), rb_gc_mark_parser(), rb_gc_mark_symbols(), rb_gc_mark_unlinked_live_method_entries(), rb_mark_end_proc(), rb_mark_generic_ivar_tbl(), rb_vm_mark(), rb_objspace::rgengc, rb_vm_struct::self, SET_STACK_END, TRUE, and rb_thread_struct::vm.
Referenced by gc_marks_body(), and rb_objspace_reachable_objects_from_root().
|
static |
Definition at line 3971 of file gc.c.
References gc_mark_children(), gc_marked(), mark_stack::index, rb_objspace::mark_stack, obj_type_name(), pop_mark_stack(), rb_bug(), RGENGC_CHECK_MODE, and shrink_stack_chunk_cache().
Referenced by gc_marks_body().
|
inlinestatic |
Definition at line 3546 of file gc.c.
References GET_HEAP_MARK_BITS, and MARKED_IN_BITMAP.
Referenced by check_gen_consistency(), gc_mark_ptr(), gc_mark_stacked_objects(), rb_gc_resurrect(), and rgengc_check_relation().
|
static |
Definition at line 4495 of file gc.c.
References FALSE, gc_marks_body(), gc_params, gc_prof_mark_timer_start(), gc_prof_mark_timer_stop(), gc_prof_record, gc_verify_internal_consistency(), rb_objspace::mark_func_data, rb_objspace::old_object_count, rb_objspace::old_object_limit, ruby_gc_params_t::oldobject_limit_factor, Qnil, rb_objspace::remembered_shady_object_count, rb_objspace::remembered_shady_object_limit, rb_objspace::rgengc, and TRUE.
Referenced by garbage_collect_body().
|
static |
Definition at line 4146 of file gc.c.
References rb_objspace::during_minor_gc, FALSE, gc_event_hook, gc_mark_roots(), gc_mark_stacked_objects(), heap_eden, rb_objspace::major_gc_count, rb_objspace::minor_gc_count, rb_objspace::parent_object_is_old, rb_objspace::profile, rb_objspace::rgengc, rgengc_mark_and_rememberset_clear(), rgengc_rememberset_mark(), rgengc_report, RUBY_INTERNAL_EVENT_GC_END_MARK, and TRUE.
Referenced by gc_marks().
|
inlinestatic |
Definition at line 2719 of file gc.c.
References RVALUE::as, RVALUE::basic, heap_page::before_sweep, BITMAP_BIT, BITMAP_INDEX, BITS_BITLENGTH, BUILTIN_TYPE, rb_objspace::during_minor_gc, heap_page::final_slots, finalizing, FL_FINALIZE, FL_TEST, RBasic::flags, heap_page::free_next, gc_finalize_deferred_register(), gc_prof_enabled, gc_prof_record, gc_setup_mark_bits(), GET_THREAD(), heap_page::heap, heap_add_freepage(), heap_add_page(), HEAP_BITMAP_LIMIT, heap_page_add_freeobj(), heap_pages_deferred_final, heap_pages_final_slots, heap_pages_swept_slots, heap_tomb, heap_unlink_page(), heap_page::limit, make_deferred(), heap_page::mark_bits, NULL, NUM_IN_PAGE, obj_free(), obj_type_name(), rb_objspace::profile, rb_bug(), rb_gc_count(), RDATA, rb_objspace::rgengc, rgengc_remembered(), rgengc_report, RVALUE_OLD_P(), heap_page::start, T_ZOMBIE, rb_objspace::total_freed_object_num, and VALGRIND_MAKE_MEM_UNDEFINED.
Referenced by gc_heap_lazy_sweep().
|
inlinestatic |
Definition at line 6842 of file gc.c.
References gc_prof_enabled, gc_prof_record, getrusage_time(), RUBY_DTRACE_GC_MARK_BEGIN, and RUBY_DTRACE_GC_MARK_BEGIN_ENABLED.
Referenced by gc_marks().
|
inlinestatic |
Definition at line 6855 of file gc.c.
References elapsed_time_from(), gc_prof_enabled, gc_prof_record, RUBY_DTRACE_GC_MARK_END, and RUBY_DTRACE_GC_MARK_END_ENABLED.
Referenced by gc_marks().
|
inlinestatic |
Definition at line 6924 of file gc.c.
References gc_prof_enabled, gc_prof_record, HEAP_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_object_num_at_gc_start, and rb_objspace::total_freed_object_num.
Referenced by gc_after_sweep().
|
inlinestatic |
Definition at line 6912 of file gc.c.
References gc_prof_enabled, gc_prof_record, malloc_increase, and malloc_limit.
Referenced by gc_before_sweep().
|
inlinestatic |
Definition at line 6763 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(), realloc, rb_objspace::records, ruby_disable_gc_stress, ruby_gc_stress, rb_objspace::run, rb_objspace::size, and usage().
Referenced by garbage_collect_body().
|
inlinestatic |
Definition at line 6869 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, RUBY_DTRACE_GC_SWEEP_BEGIN, and RUBY_DTRACE_GC_SWEEP_BEGIN_ENABLED.
Referenced by gc_heap_lazy_sweep(), and gc_sweep().
|
inlinestatic |
Definition at line 6884 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, RUBY_DTRACE_GC_SWEEP_END, and RUBY_DTRACE_GC_SWEEP_END_ENABLED.
Referenced by gc_heap_lazy_sweep(), and gc_sweep().
|
inlinestatic |
Definition at line 6807 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 garbage_collect_body().
|
inlinestatic |
Definition at line 6832 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 garbage_collect_body().
|
static |
Definition at line 6952 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 7304 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 7102 of file gc.c.
References CALC_EXACT_MALLOC_SIZE, 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, PRIdSIZE, 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 7287 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 7272 of file gc.c.
References rb_objspace::profile, Qfalse, Qtrue, rb_objspace, and rb_objspace::run.
Referenced by Init_GC().
|
static |
Definition at line 7019 of file gc.c.
References DBL2NUM, gc_profile_record::flags, gc_info_decode(), gc_profile_record::gc_invoke_time, gc_profile_record::gc_time, GPR_FLAG_HAVE_FINALIZE, gc_profile_record::heap_total_objects, gc_profile_record::heap_total_size, gc_profile_record::heap_use_size, ID2SYM, rb_objspace::next_index, 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, and SIZET2NUM.
Referenced by Init_GC().
Definition at line 7225 of file gc.c.
References argc, argv, gc_profile_dump_on(), Qnil, rb_io_write(), rb_scan_args(), and rb_stdout.
Referenced by Init_GC().
|
static |
Definition at line 7208 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 7248 of file gc.c.
References 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().
|
static |
Definition at line 3053 of file gc.c.
References gc_heap_rest_sweep(), heap_page::heap, and heap_eden.
Referenced by garbage_collect(), objspace_malloc_increase(), rb_gc_disable(), rb_objspace_call_finalizer(), rb_objspace_each_objects(), and rb_objspace_free().
|
static |
Definition at line 5693 of file gc.c.
References gc_params, heap_add_pages(), heap_eden, ruby_gc_params_t::heap_init_slots, HEAP_OBJ_LIMIT, objspace_and_reason::objspace, and rb_objspace.
Referenced by ruby_gc_set_params().
|
static |
Definition at line 2707 of file gc.c.
References HEAP_BITMAP_SIZE, heap_page::mark_bits, and heap_page::oldgen_bits.
Referenced by gc_page_sweep().
Definition at line 5154 of file gc.c.
References argc, argv, finalize_deferred(), finalizing, objspace_and_reason::full_mark, garbage_collect(), GPR_FLAG_METHOD, objspace_and_reason::immediate_sweep, NIL_P, objspace_and_reason::objspace, Qnil, Qundef, rb_get_kwargs(), rb_intern, rb_objspace, rb_scan_args(), RTEST, and TRUE.
Referenced by Init_GC().
Definition at line 5536 of file gc.c.
References argc, argv, 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().
Definition at line 5355 of file gc.c.
References count, rb_objspace::count, hash(), heap_eden, heap_increment(), heap_pages_final_slots, heap_pages_increment, heap_pages_length, heap_pages_swept_slots, heap_pages_used, heap_tomb, key, rb_objspace::major_gc_count, malloc_increase, malloc_limit, rb_objspace::minor_gc_count, objspace_and_reason::objspace, objspace_free_slot(), objspace_live_slot(), rb_objspace::old_object_count, rb_objspace::old_object_limit, rb_objspace::oldmalloc_increase, rb_objspace::oldmalloc_increase_limit, rb_objspace::profile, Qnil, rb_eArgError, rb_eTypeError, rb_id2str(), rb_objspace, rb_raise(), RB_TYPE_P, rb_objspace::remembered_shady_object_count, rb_objspace::remembered_shady_object_limit, rb_objspace::rgengc, RSTRING_PTR, S, SET, SYM2ID, SYMBOL_P, T_HASH, rb_objspace::total_allocated_object_num, and rb_objspace::total_freed_object_num.
Referenced by gc_stat(), and rb_gc_stat().
Definition at line 5578 of file gc.c.
References objspace_and_reason::objspace, rb_objspace, and ruby_gc_stress.
Referenced by Init_GC().
Definition at line 5597 of file gc.c.
References FIXNUM_P, objspace_and_reason::objspace, Qfalse, Qtrue, rb_objspace, rb_secure(), RTEST, and ruby_gc_stress.
Referenced by Init_GC().
|
static |
Definition at line 3060 of file gc.c.
References heap_page::before_sweep, gc_before_sweep(), gc_heap_lazy_sweep(), gc_heap_prepare_minimum_pages(), gc_heap_rest_sweep(), gc_prof_sweep_timer_start(), gc_prof_sweep_timer_stop(), heap_eden, and heap_page::next.
Referenced by garbage_collect_body().
Definition at line 4227 of file gc.c.
References each_obj_args::callback, each_obj_args::data, verify_internal_consistency_struct::err_count, verify_internal_consistency_struct::objspace, objspace_each_objects(), Qnil, rb_bug(), rb_objspace, and verify_internal_consistency_i().
Referenced by gc_marks(), and Init_GC().
|
static |
Definition at line 5088 of file gc.c.
References objspace_and_reason::full_mark, garbage_collect(), objspace_and_reason::immediate_sweep, objspace_and_reason::objspace, and objspace_and_reason::reason.
Referenced by garbage_collect_with_gvl().
|
static |
Definition at line 5673 of file gc.c.
References getenv, name, NULL, RTEST, ruby_verbose, strtod, and val.
Referenced by ruby_gc_set_params().
|
static |
Definition at line 5653 of file gc.c.
References getenv, name, NULL, RTEST, ruby_verbose, and val.
Referenced by ruby_gc_set_params().
|
static |
Definition at line 6709 of file gc.c.
References clock_gettime(), getrusage(), t(), timespec::tv_nsec, timeval::tv_sec, timespec::tv_sec, timeval::tv_usec, and usage().
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 967 of file gc.c.
References heap_page::free_next, rb_heap_struct::free_pages, heap_page::freelist, and heap_page::heap.
Referenced by gc_page_sweep(), and heap_assign_page().
|
static |
Definition at line 1130 of file gc.c.
References heap_page::heap, heap_page::limit, heap_page::next, rb_heap_struct::page_length, rb_heap_struct::pages, heap_page::prev, and rb_heap_struct::total_slots.
Referenced by gc_page_sweep(), and heap_assign_page().
|
static |
Definition at line 1149 of file gc.c.
References add, heap_page::heap, heap_assign_page(), heap_pages_expand_sorted(), and heap_pages_increment.
Referenced by gc_set_initial_pages(), and Init_heap().
|
static |
Definition at line 1141 of file gc.c.
References heap_page::heap, heap_add_freepage(), heap_add_page(), and heap_page_create().
Referenced by heap_add_pages(), and heap_increment().
|
inlinestatic |
Definition at line 1249 of file gc.c.
References RVALUE::as, RVALUE::free, rb_heap_struct::freelist, heap_page::heap, and heap_get_freeobj_from_next_freepage().
Referenced by newobj_of().
|
static |
Definition at line 1230 of file gc.c.
References heap_page::free_next, rb_heap_struct::free_pages, heap_page::freelist, heap_page::heap, heap_prepare_freepage(), NULL, and rb_heap_struct::using_page.
Referenced by heap_get_freeobj().
|
static |
Definition at line 1184 of file gc.c.
References FALSE, heap_page::heap, heap_assign_page(), heap_pages_increment, heap_pages_length, rb_heap_struct::page_length, rgengc_report, and TRUE.
Referenced by gc_after_sweep(), gc_heap_prepare_minimum_pages(), gc_stat_internal(), heap_prepare_freepage(), and heap_ready_to_gc().
|
inlinestatic |
Definition at line 2230 of file gc.c.
References heap_page::before_sweep, FALSE, GET_HEAP_PAGE, and TRUE.
Referenced by is_swept_object().
|
inlinestatic |
Definition at line 957 of file gc.c.
References RVALUE::as, RVALUE::free, heap_page::freelist, obj_type_name(), and rgengc_report.
Referenced by finalize_list(), gc_page_sweep(), heap_page_allocate(), and rb_gc_force_recycle().
|
static |
Definition at line 1026 of file gc.c.
References aligned_free(), aligned_malloc(), assert, heap_page::body, during_gc, heap_page_body::header, HEAP_ALIGN, HEAP_OBJ_LIMIT, heap_page_add_freeobj(), heap_pages_himem, heap_pages_length, heap_pages_lomem, heap_pages_sorted, heap_pages_used, HEAP_SIZE, hi, heap_page::limit, lo, malloc, MEMMOVE, MEMZERO, heap_page_header::page, PRIuVALUE, rb_bug(), rb_memerror(), rgengc_report, and heap_page::start.
Referenced by heap_page_create().
|
static |
Definition at line 1116 of file gc.c.
References heap_page_allocate(), heap_page_resurrect(), heap_pages_length, heap_pages_used, heap_tomb, and NULL.
Referenced by heap_assign_page().
|
static |
Definition at line 989 of file gc.c.
References aligned_free(), heap_page::body, free(), and heap_pages_used.
Referenced by heap_pages_free_unused_pages(), and rb_objspace_free().
|
static |
Definition at line 1104 of file gc.c.
References heap_tomb, heap_unlink_page(), and NULL.
Referenced by heap_page_create().
|
static |
Definition at line 927 of file gc.c.
References during_gc, heap_eden, heap_pages_increment, heap_pages_length, heap_pages_sorted, heap_tomb, malloc, rb_memerror(), realloc, rgengc_report, and size.
Referenced by heap_add_pages(), and heap_set_increment().
|
static |
Definition at line 997 of file gc.c.
References assert, heap_page::final_slots, heap_page::heap, heap_page_free(), heap_pages_max_free_slots, heap_pages_sorted, heap_pages_swept_slots, heap_pages_used, heap_tomb, heap_unlink_page(), and heap_page::limit.
Referenced by gc_after_sweep().
|
static |
Definition at line 1198 of file gc.c.
References rb_objspace::dont_lazy_sweep, during_gc, err, FALSE, rb_objspace::flags, rb_heap_struct::free_pages, garbage_collect(), garbage_collect_body(), GC_ENABLE_LAZY_SWEEP, gc_heap_lazy_sweep(), GPR_FLAG_NEWOBJ, heap_page::heap, heap_increment(), heap_ready_to_gc(), is_lazy_sweeping, rb_objspace::profile, rb_memerror(), and TRUE.
Referenced by heap_get_freeobj_from_next_freepage().
|
static |
Definition at line 5035 of file gc.c.
References dont_gc, during_gc, FALSE, rb_heap_struct::free_pages, rb_heap_struct::freelist, heap_increment(), heap_set_increment(), and TRUE.
Referenced by heap_prepare_freepage(), and ready_to_gc().
|
static |
Definition at line 1162 of file gc.c.
References gc_params, ruby_gc_params_t::growth_factor, ruby_gc_params_t::growth_max_slots, HEAP_OBJ_LIMIT, heap_pages_expand_sorted(), heap_pages_increment, heap_pages_length, heap_pages_used, and heap_tomb.
Referenced by gc_after_sweep(), gc_heap_prepare_minimum_pages(), and heap_ready_to_gc().
|
static |
Definition at line 976 of file gc.c.
References heap_page::heap, heap_page::limit, heap_page::next, NULL, rb_heap_struct::page_length, rb_heap_struct::pages, heap_page::prev, and rb_heap_struct::total_slots.
Referenced by gc_page_sweep(), heap_page_resurrect(), and heap_pages_free_unused_pages().
Definition at line 2301 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_id2name(), rb_objspace, rb_raise(), and RBASIC.
Referenced by Init_GC().
void Init_GC | ( | void | ) |
Definition at line 7475 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(), gc_verify_internal_consistency(), HEAP_BITMAP_PLANES, HEAP_BITMAP_SIZE, HEAP_OBJ_LIMIT, id2ref(), ID2SYM, MALLOC_ALLOCATED_SIZE, MALLOC_ALLOCATED_SIZE_CHECK, nomem_error, OBJ_FREEZE, OBJ_TAINT, 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_exc_new3, rb_gc_disable(), rb_gc_enable(), rb_hash_aset(), rb_hash_new(), rb_include_module(), rb_intern, rb_mEnumerable, rb_mGC, rb_mKernel, rb_obj_freeze(), rb_obj_id(), rb_str_new2, RGENGC_CHECK_MODE, RGENGC_DEBUG, RGENGC_ESTIMATE_OLDMALLOC, RGENGC_PROFILE, RGENGC_THREEGEN, 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 1661 of file gc.c.
References finalizer_table, free(), gc_params, GET_THREAD(), getrusage_time(), heap_add_pages(), heap_eden, ruby_gc_params_t::heap_init_slots, HEAP_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, and st_init_numtable().
Referenced by ruby_setup().
|
static |
Definition at line 3206 of file gc.c.
References add_stack_chunk_cache(), mark_stack::cache_size, mark_stack::index, mark_stack::limit, push_mark_stack_chunk(), stack_chunk_alloc(), STACK_CHUNK_SIZE, and mark_stack::unused_cache_size.
Referenced by Init_heap().
void Init_stack | ( | volatile VALUE * | addr | ) |
Definition at line 5127 of file gc.c.
References ruby_init_stack().
|
static |
Definition at line 1787 of file gc.c.
References RVALUE::as, RVALUE::basic, BUILTIN_TYPE, FL_SINGLETON, FL_TEST, RBasic::flags, RBasic::klass, T_CLASS, T_ICLASS, T_NODE, T_NONE, and T_ZOMBIE.
Referenced by os_obj_of_i(), and rb_objspace_internal_object_p().
|
inlinestatic |
Definition at line 2248 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().
|
inlinestatic |
Definition at line 2221 of file gc.c.
References BUILTIN_TYPE, FALSE, is_pointer_to_heap(), T_FIXNUM, T_ICLASS, and TRUE.
Referenced by id2ref(), wmap_aref(), wmap_each_i(), wmap_each_key_i(), wmap_each_value_i(), wmap_keys_i(), and wmap_values_i().
|
inlinestatic |
Definition at line 2256 of file gc.c.
References BUILTIN_TYPE, FALSE, is_dead_object(), 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 3105 of file gc.c.
References mark_stack::chunk, and NULL.
Referenced by pop_mark_stack().
|
inlinestatic |
Definition at line 2267 of file gc.c.
References BUILTIN_TYPE, is_pointer_to_heap(), rb_bug(), rb_special_const_p(), RGENGC_CHECK_MODE, T_NONE, and T_ZOMBIE.
Referenced by gc_mark(), gc_mark_children(), rb_objspace_markable_object_p(), and rb_objspace_reachable_objects_from().
|
inlinestatic |
Definition at line 1405 of file gc.c.
References FALSE, heap_pages_himem, heap_pages_sorted, heap_pages_used, hi, heap_page::limit, lo, RANY, heap_page::start, and TRUE.
Referenced by check_gen_consistency(), gc_mark_maybe(), is_id_value(), and is_markable_object().
|
inlinestatic |
Definition at line 2237 of file gc.c.
References FALSE, heap_eden, heap_is_swept_object(), and TRUE.
Referenced by is_dead_object(), and rb_gc_resurrect().
|
static |
Definition at line 2680 of file gc.c.
References rb_objspace::dont_lazy_sweep, FALSE, rb_objspace::flags, Qnil, and rb_objspace.
Referenced by rb_objspace_each_objects().
|
inlinestatic |
Definition at line 1473 of file gc.c.
References RVALUE::as, RVALUE::basic, RBasic::flags, RVALUE::free, heap_pages_deferred_final, and T_ZOMBIE.
Referenced by gc_page_sweep(), make_io_deferred(), obj_free(), and rb_objspace_call_finalizer().
|
inlinestatic |
Definition at line 1481 of file gc.c.
References RVALUE::as, RVALUE::data, RData::data, RData::dfree, RVALUE::file, RFile::fptr, make_deferred(), and rb_io_fptr_finalize().
Referenced by obj_free(), and rb_objspace_call_finalizer().
|
static |
Definition at line 3450 of file gc.c.
References rb_const_entry_struct::file, gc_mark(), mark_tbl_arg::objspace, ST_CONTINUE, and rb_const_entry_struct::value.
Referenced by mark_const_tbl().
|
static |
Definition at line 3459 of file gc.c.
References mark_const_entry_i(), mark_tbl_arg::objspace, st_data_t, and st_foreach().
|
static |
Definition at line 3478 of file gc.c.
References FLUSH_REGISTER_WINDOWS, GET_STACK_BOUNDS, rb_thread_struct::machine, mark_locations_array(), numberof, rb_gc_mark_locations, rb_jmp_buf, rb_setjmp, SET_STACK_END, STACK_END, and STACK_START.
Referenced by gc_mark_roots().
Definition at line 3326 of file gc.c.
References gc_mark(), mark_tbl_arg::objspace, and ST_CONTINUE.
Referenced by mark_tbl().
|
static |
Definition at line 3375 of file gc.c.
References mark_keyvalue(), mark_tbl_arg::objspace, st_data_t, and st_foreach().
Referenced by rb_mark_hash().
Definition at line 3343 of file gc.c.
References gc_mark(), key, mark_tbl_arg::objspace, and ST_CONTINUE.
Referenced by mark_set().
Definition at line 3366 of file gc.c.
References gc_mark(), key, mark_tbl_arg::objspace, and ST_CONTINUE.
Referenced by mark_hash().
|
static |
Definition at line 3293 of file gc.c.
References gc_mark_maybe().
Referenced by gc_mark_children(), gc_mark_locations(), and mark_current_machine_context().
|
static |
Definition at line 3434 of file gc.c.
References LIKELY, rb_objspace::mark_func_data, mark_method_entry_i(), mark_tbl_arg::objspace, rb_gc_count(), method_table_wrapper::serial, st_data_t, st_foreach(), and method_table_wrapper::tbl.
|
static |
Definition at line 3390 of file gc.c.
References rb_method_definition_struct::attr, rb_method_definition_struct::body, rb_method_entry_struct::def, gc_mark(), rb_method_definition_struct::iseq, rb_method_entry_struct::klass, rb_method_attr_struct::location, mark_tbl_arg::objspace, rb_method_definition_struct::orig_me, rb_method_definition_struct::proc, rb_iseq_struct::self, rb_method_definition_struct::type, VM_METHOD_TYPE_ATTRSET, VM_METHOD_TYPE_BMETHOD, VM_METHOD_TYPE_ISEQ, VM_METHOD_TYPE_IVAR, and VM_METHOD_TYPE_REFINED.
Referenced by mark_method_entry_i(), and rb_mark_method_entry().
|
static |
Definition at line 3426 of file gc.c.
References mark_method_entry(), mark_tbl_arg::objspace, and ST_CONTINUE.
Referenced by mark_m_tbl_wrapper().
|
static |
Definition at line 3351 of file gc.c.
References mark_key(), mark_tbl_arg::objspace, st_data_t, and st_foreach().
Referenced by rb_mark_set().
|
static |
Definition at line 3334 of file gc.c.
References mark_entry(), st_table::num_entries, mark_tbl_arg::objspace, st_data_t, and st_foreach().
Referenced by gc_mark_roots(), and rb_mark_tbl().
|
static |
Definition at line 5843 of file gc.c.
References EXIT_FAILURE, msg, 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_malloc_prepare(), and objspace_xrealloc().
|
static |
Definition at line 5836 of file gc.c.
References rb_eNoMemError, and rb_raise().
Referenced by negative_size_allocation_error().
Definition at line 1285 of file gc.c.
References assert, BUILTIN_TYPE, dont_gc, during_gc, FALSE, FL_SET, FL_TAINT, FL_WB_PROTECTED, garbage_collect(), gc_event_hook, GPR_FLAG_NEWOBJ, heap_eden, heap_get_freeobj(), obj_type_name(), rb_objspace::profile, RANY, rb_bug(), rb_memerror(), rb_objspace, rb_safe_level, rb_sourcefile, rb_sourceline(), RBASIC, RBASIC_SET_CLASS_RAW, rgengc_remembered(), rgengc_report, ruby_disable_gc_stress, ruby_gc_stress, RUBY_INTERNAL_EVENT_NEWOBJ, RVALUE_PROMOTED_P(), SPECIAL_CONST_P, rb_objspace::total_allocated_object_num, and UNLIKELY.
Referenced by rb_data_object_alloc(), rb_data_typed_object_alloc(), rb_newobj(), rb_newobj_of(), and rb_node_newnode().
|
static |
Definition at line 1490 of file gc.c.
References BUILTIN_TYPE, rmatch::char_offset, CLEAR_IN_BITMAP, DATA_PTR, FALSE, FL_EXIVAR, FL_TEST, FL_UNSET, gc_event_hook, GET_HEAP_OLDGEN_BITS, make_deferred(), make_io_deferred(), MARKED_IN_BITMAP, nd_type, NODE_ALLOCA, NODE_ARGS, NODE_SCOPE, 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_m_tbl_wrapper(), rb_str_free(), RBASIC, RBIGNUM_DIGITS, RBIGNUM_EMBED_FLAG, RCLASS_CONST_TBL, RCLASS_EXT, RCLASS_IV_INDEX_TBL, RCLASS_IV_TBL, RCLASS_M_TBL_WRAPPER, RDATA, rmatch::regs, ROBJECT_EMBED, RSTRUCT_EMBED_LEN_MASK, RTYPEDDATA_P, RUBY_DEFAULT_FREE, RUBY_INTERNAL_EVENT_FREEOBJ, RUBY_TYPED_FREE_IMMEDIATELY, 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_MATCH, T_MODULE, T_NIL, T_NODE, T_OBJECT, T_RATIONAL, T_REGEXP, T_STRING, T_STRUCT, T_TRUE, and xfree().
Referenced by gc_page_sweep().
|
static |
Definition at line 2429 of file gc.c.
References BDIGIT, BUILTIN_TYPE, rmatch::char_offset_num_allocated, FL_EXIVAR, FL_TEST, nd_type, NODE_ALLOCA, NODE_SCOPE, onig_memsize(), onig_region_memsize(), rb_ary_memsize(), rb_bug(), rb_generic_ivar_memsize(), rb_io_memsize(), rb_objspace_data_type_memsize(), rb_str_memsize(), RBASIC, RBIGNUM_DIGITS, RBIGNUM_EMBED_FLAG, RBIGNUM_LEN, RCLASS, RCLASS_EXT, RCLASS_IV_INDEX_TBL, RCLASS_IV_TBL, RCLASS_M_TBL, RCLASS_M_TBL_WRAPPER, rmatch::regs, RFILE, RHASH, RMATCH, RNODE, ROBJECT, ROBJECT_EMBED, RREGEXP, 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_MATCH, T_MODULE, T_NODE, T_OBJECT, T_RATIONAL, T_REGEXP, T_STRING, T_STRUCT, and T_ZOMBIE.
Referenced by check_gen_consistency(), and rb_obj_memsize_of().
Definition at line 7357 of file gc.c.
References TYPE, and type_name().
Referenced by check_gen_consistency(), gc_mark_children(), gc_mark_stacked_objects(), gc_page_sweep(), heap_page_add_freeobj(), newobj_of(), rb_gc_unprotect_logging(), rb_gc_writebarrier(), rb_gc_writebarrier_unprotect_promoted(), rgengc_remember(), rgengc_remembered(), rgengc_rememberset_mark(), RVALUE_DEMOTE_FROM_OLD(), RVALUE_PROMOTE_INFANT(), and verify_internal_consistency_reachable_i().
Definition at line 1695 of file gc.c.
References heap_page::body, each_obj_args::callback, each_obj_args::data, heap_pages_sorted, heap_pages_used, heap_page::limit, Qnil, rb_objspace, and heap_page::start.
Referenced by gc_verify_internal_consistency(), and rb_objspace_each_objects().
|
static |
Definition at line 2701 of file gc.c.
References heap_pages_final_slots, objspace_live_slot(), and objspace_total_slot().
Referenced by gc_stat_internal().
|
static |
Definition at line 2689 of file gc.c.
References rb_objspace::profile, rb_objspace::total_allocated_object_num, and rb_objspace::total_freed_object_num.
Referenced by gc_stat_internal(), and objspace_free_slot().
|
inlinestatic |
Definition at line 6073 of file gc.c.
References size.
Referenced by objspace_xcalloc(), and objspace_xmalloc().
|
static |
Definition at line 5981 of file gc.c.
References assert, ATOMIC_SIZE_ADD, ATOMIC_SIZE_INC, atomic_sub_nounderflow(), FALSE, garbage_collect_with_gvl(), gc_rest_sweep(), 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, new_size(), rb_objspace::oldmalloc_increase, rb_bug(), rb_objspace::rgengc, ruby_disable_gc_stress, ruby_gc_stress, ruby_thread_has_gvl_p(), TRUE, and type.
Referenced by objspace_xfree(), objspace_xmalloc(), and objspace_xrealloc().
|
inlinestatic |
Definition at line 6058 of file gc.c.
References negative_size_allocation_error(), and size.
Referenced by objspace_xcalloc(), and objspace_xmalloc().
|
inlinestatic |
Definition at line 5953 of file gc.c.
Referenced by objspace_xfree(), objspace_xmalloc(), and objspace_xrealloc().
|
static |
Definition at line 2695 of file gc.c.
References heap_eden, and heap_tomb.
Referenced by gc_before_sweep(), and objspace_free_slot().
|
static |
Definition at line 6181 of file gc.c.
References calloc, count, objspace_malloc_fixup(), objspace_malloc_prepare(), size, TRY_WITH_GC, and xmalloc2_size().
Referenced by ruby_xcalloc().
|
static |
Definition at line 6145 of file gc.c.
References free(), MEMOP_TYPE_FREE, objspace_malloc_increase(), and objspace_malloc_size().
Referenced by objspace_xrealloc(), and ruby_sized_xfree().
|
static |
Definition at line 6092 of file gc.c.
References malloc, MEMOP_TYPE_MALLOC, objspace_malloc_fixup(), objspace_malloc_increase(), objspace_malloc_prepare(), objspace_malloc_size(), size, and TRY_WITH_GC.
Referenced by objspace_xrealloc(), ruby_xmalloc(), and ruby_xmalloc2().
|
static |
Definition at line 6104 of file gc.c.
References MEMOP_TYPE_REALLOC, negative_size_allocation_error(), new_size(), 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 1882 of file gc.c.
References argc, argv, os_each_struct::of, os_obj_of(), rb_scan_args(), and RETURN_ENUMERATOR.
Referenced by Init_GC().
Definition at line 1835 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 1816 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 3190 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_stacked_objects().
|
static |
Definition at line 3154 of file gc.c.
References add_stack_chunk_cache(), assert, mark_stack::chunk, mark_stack::index, mark_stack::limit, stack_chunk::next, and heap_page::prev.
Referenced by pop_mark_stack().
|
static |
Definition at line 3181 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_mark().
|
static |
Definition at line 3133 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, stack_chunk_alloc(), and mark_stack::unused_cache_size.
Referenced by init_mark_stack(), and push_mark_stack().
size_t rb_ary_memsize | ( | VALUE | ) |
Definition at line 552 of file array.c.
References ARY_OWNS_HEAP_P, and RARRAY.
Referenced by obj_memsize_of().
VALUE rb_data_object_alloc | ( | VALUE | klass, |
void * | datap, | ||
RUBY_DATA_FUNC | dmark, | ||
RUBY_DATA_FUNC | dfree | ||
) |
Definition at line 1369 of file gc.c.
References Check_Type, newobj_of(), T_CLASS, and T_DATA.
VALUE rb_data_typed_object_alloc | ( | VALUE | klass, |
void * | datap, | ||
const rb_data_type_t * | type | ||
) |
Definition at line 1376 of file gc.c.
References Check_Type, newobj_of(), T_CLASS, T_DATA, T_MASK, and type.
Referenced by iow_newobj().
Definition at line 1990 of file gc.c.
References define_final0(), should_be_callable(), and should_be_finalizable().
int rb_during_gc | ( | void | ) |
Definition at line 5201 of file gc.c.
References during_gc, objspace_and_reason::objspace, and rb_objspace.
void rb_free_const_table | ( | st_table * | tbl | ) |
Definition at line 1466 of file gc.c.
References free_const_entry_i(), st_foreach(), and st_free_table().
Referenced by init_copy(), obj_free(), and rb_mod_init_copy().
void rb_free_m_tbl | ( | st_table * | tbl | ) |
Definition at line 1443 of file gc.c.
References free_method_entry_i(), st_foreach(), and st_free_table().
Referenced by rb_free_m_tbl_wrapper().
void rb_free_m_tbl_wrapper | ( | struct method_table_wrapper * | wrapper | ) |
Definition at line 1450 of file gc.c.
References rb_free_m_tbl(), method_table_wrapper::tbl, and xfree().
Referenced by obj_free(), and rb_mod_init_copy().
int rb_garbage_collect | ( | void | ) |
Definition at line 5119 of file gc.c.
References garbage_collect(), GPR_FLAG_CAPI, and TRUE.
void rb_gc | ( | void | ) |
Definition at line 5193 of file gc.c.
References finalize_deferred(), finalizing, garbage_collect(), GPR_FLAG_CAPI, objspace_and_reason::objspace, rb_objspace, and TRUE.
Referenced by dir_initialize(), getDevice(), rb_fdopen(), rb_gc_start(), rb_pipe(), rb_sysopen(), rsock_s_accept(), rsock_socket(), and ruby_dup().
void rb_gc_call_finalizer_at_exit | ( | void | ) |
Definition at line 2144 of file gc.c.
References rb_objspace_call_finalizer().
Referenced by ruby_finalize_1().
Definition at line 1998 of file gc.c.
References finalizer_table, FL_FINALIZE, FL_SET, FL_TEST, rb_objspace, st_data_t, st_insert(), and st_lookup().
Referenced by init_copy().
size_t rb_gc_count | ( | void | ) |
Definition at line 5222 of file gc.c.
References rb_objspace::count, and rb_objspace::profile.
Referenced by gc_after_sweep(), gc_before_sweep(), gc_count(), gc_page_sweep(), mark_m_tbl_wrapper(), and newobj_i().
VALUE rb_gc_disable | ( | void | ) |
Definition at line 5641 of file gc.c.
References dont_gc, gc_rest_sweep(), objspace_and_reason::objspace, Qfalse, Qtrue, rb_objspace, and TRUE.
Referenced by cbsubst_scan_args(), Init_GC(), ip_ruby_cmd(), lib_merge_tklist(), lib_split_tklist_core(), tcl_protect_core(), and tk_conv_args().
VALUE rb_gc_enable | ( | void | ) |
Definition at line 5619 of file gc.c.
References dont_gc, FALSE, objspace_and_reason::objspace, Qfalse, Qtrue, and rb_objspace.
Referenced by cbsubst_scan_args(), Init_GC(), ip_ruby_cmd(), lib_merge_tklist(), lib_split_tklist_core(), tcl_protect_core(), and tk_conv_args().
void rb_gc_finalize_deferred | ( | void | ) |
Definition at line 2112 of file gc.c.
References gc_finalize_deferred().
void rb_gc_force_recycle | ( | VALUE | p | ) |
Definition at line 4900 of file gc.c.
References heap_page::before_sweep, CLEAR_IN_BITMAP, GET_HEAP_MARK_BITS, GET_HEAP_OLDGEN_BITS, GET_HEAP_PAGE, GET_HEAP_REMEMBERSET_BITS, heap_page_add_freeobj(), rb_objspace::profile, rb_objspace, and rb_objspace::total_freed_object_num.
Referenced by call_queue_handler(), dispose_string(), eval_queue_handler(), fixup_nodes(), invoke_queue_handler(), literal_concat_gen(), parser_heredoc_restore(), parser_yylex(), rb_ary_decrement_share(), rb_parser_free(), rb_str_conv_enc_opts(), ruby_vm_destruct(), and yyparse().
Definition at line 5321 of file gc.c.
References gc_info_decode(), key, rb_objspace::latest_gc_info, objspace_and_reason::objspace, rb_objspace::profile, and rb_objspace.
void rb_gc_mark | ( | VALUE | ptr | ) |
Definition at line 3607 of file gc.c.
References gc_mark().
Referenced by _thread_call_proc_arg_mark(), addrinfo_mark(), argf_mark(), autoload_i_mark(), backtrace_mark(), bm_mark(), call_queue_mark(), cont_mark(), cparse_params_mark(), d_lite_gc_mark(), dir_mark(), dlcfunc_mark(), dlptr_mark(), enumerator_mark(), eval_queue_mark(), fiber_mark(), fiddle_ptr_mark(), gc_mark_roots(), generator_mark(), givar_mark_i(), gzfile_mark(), invoke_queue_mark(), iow_mark(), location_mark(), location_mark_entry(), mark_dump_arg(), mark_exec_arg(), mark_marshal_compat_i(), parser_mark(), random_mark(), rb_mark_end_proc(), rb_thread_mark(), rb_vm_mark(), rb_vm_trace_mark_event_hooks(), strio_mark(), strscan_mark(), subst_mark(), thread_shield_mark(), time_mark(), tp_mark(), vm_mark_each_thread_func(), wmap_mark(), yielder_mark(), and zstream_mark().
Definition at line 3314 of file gc.c.
References gc_mark_locations(), and heap_page::start.
void rb_gc_mark_machine_stack | ( | rb_thread_t * | th | ) |
Definition at line 3509 of file gc.c.
References GET_STACK_BOUNDS, rb_thread_struct::machine, rb_gc_mark_locations, and rb_objspace.
Referenced by rb_thread_mark().
void rb_gc_mark_maybe | ( | VALUE | obj | ) |
Definition at line 3540 of file gc.c.
References gc_mark_maybe().
Referenced by gc_mark_roots(), JSON_mark(), mark_global_entry(), val_marker(), and var_marker().
void rb_gc_register_address | ( | VALUE * | addr | ) |
Definition at line 4930 of file gc.c.
References ALLOC, global_List, gc_list::next, rb_objspace, and gc_list::varptr.
Referenced by Init_coverage(), Init_readline(), and rb_global_variable().
void rb_gc_register_mark_object | ( | VALUE | obj | ) |
Definition at line 4923 of file gc.c.
References GET_THREAD(), rb_vm_struct::mark_object_ary, rb_ary_push(), and rb_thread_struct::vm.
Referenced by compat_allocator_table(), date__strptime_internal(), date_zone_to_diff(), Init_date_core(), Init_Encoding(), Init_IO(), Init_load(), Init_Random(), Init_VM(), Init_win32ole(), power_cache_get_power(), pruby_init(), rb_define_class_id_under(), rb_define_module_id_under(), regcomp(), rt_complete_frags(), ruby_process_options(), and sym_to_proc().
void rb_gc_resurrect | ( | VALUE | obj | ) |
Definition at line 3615 of file gc.c.
References gc_mark_ptr(), gc_marked(), heap_eden, is_lazy_sweeping, is_swept_object(), and rb_objspace.
Referenced by fstr_update_callback().
void rb_gc_set_params | ( | void | ) |
Definition at line 5776 of file gc.c.
References rb_safe_level, and ruby_gc_set_params().
size_t rb_gc_stat | ( | VALUE | key | ) |
Definition at line 5558 of file gc.c.
References gc_stat_internal(), key, and SYMBOL_P.
void rb_gc_unprotect_logging | ( | void * | objptr, |
const char * | filename, | ||
int | line | ||
) |
Definition at line 4807 of file gc.c.
References cnt, malloc, obj_type_name(), OBJ_WB_PROTECTED, rgengc_unprotect_logging_exit_func(), rgengc_unprotect_logging_table, snprintf, st_data_t, st_init_strtable(), st_insert(), st_lookup(), and strlen().
void rb_gc_unregister_address | ( | VALUE * | addr | ) |
Definition at line 4942 of file gc.c.
References global_List, gc_list::next, rb_objspace, t(), gc_list::varptr, and xfree().
Definition at line 4734 of file gc.c.
References obj_type_name(), rb_bug(), rb_objspace, RGENGC_CHECK_MODE, rgengc_remember(), rgengc_remembered(), rgengc_report, RVALUE_OLD_BITMAP_P(), RVALUE_OLD_P(), and RVALUE_PROMOTED_P().
Referenced by rb_obj_written().
void rb_gc_writebarrier_remember_promoted | ( | VALUE | obj | ) |
Definition at line 4785 of file gc.c.
References rb_objspace, and rgengc_remember().
Referenced by ary_memcpy(), rb_ary_modify(), rb_hash_keys(), and rb_hash_values().
void rb_gc_writebarrier_unprotect_promoted | ( | VALUE | obj | ) |
Definition at line 4752 of file gc.c.
References BUILTIN_TYPE, obj_type_name(), rb_objspace::profile, rb_bug(), rb_objspace, rb_objspace::remembered_shady_object_count, rb_objspace::rgengc, RGENGC_CHECK_MODE, rgengc_remember(), rgengc_remembered(), rgengc_report, RVALUE_DEMOTE_FROM_OLD(), RVALUE_OLD_P(), RVALUE_PROMOTED_P(), and RVALUE_WB_PROTECTED.
Referenced by rb_obj_wb_unprotect().
void rb_gcdebug_print_obj_condition | ( | VALUE | obj | ) |
size_t rb_generic_ivar_memsize | ( | VALUE | ) |
Definition at line 1040 of file variable.c.
References generic_iv_tbl, st_data_t, st_lookup(), and st_memsize().
Referenced by obj_memsize_of().
void rb_global_variable | ( | VALUE * | var | ) |
Definition at line 4965 of file gc.c.
References rb_gc_register_address().
Referenced by Init_openssl(), Init_ossl_asn1(), Init_RandomSeed(), Init_Regexp(), Init_tcltklib(), and Init_tkutil().
Definition at line 4303 of file io.c.
References rb_io_buffer_t::capa, rb_io_t::cbuf, finish_writeconv_arg::fptr, rb_econv_memsize(), rb_io_t::rbuf, rb_io_t::readconv, size, rb_io_t::wbuf, and rb_io_t::writeconv.
Referenced by obj_memsize_of().
void rb_mark_hash | ( | st_table * | tbl | ) |
Definition at line 3384 of file gc.c.
References mark_hash().
Referenced by Init_win32ole(), mark_dump_arg(), and mark_load_arg().
void rb_mark_method_entry | ( | const rb_method_entry_t * | me | ) |
Definition at line 3420 of file gc.c.
References mark_method_entry().
Referenced by bm_mark(), rb_gc_mark_unlinked_live_method_entries(), and rb_thread_mark().
void rb_mark_set | ( | st_table * | tbl | ) |
void rb_mark_tbl | ( | st_table * | tbl | ) |
Definition at line 3522 of file gc.c.
References mark_tbl().
Referenced by autoload_mark(), mark_load_arg(), rb_gc_mark_symbols(), rb_mark_generic_ivar(), rb_thread_mark(), and rb_vm_mark().
void rb_memerror | ( | void | ) |
Definition at line 5885 of file gc.c.
References rb_thread_struct::errinfo, EXIT_FAILURE, GET_THREAD(), JUMP_TAG, nomem_error, RAISED_NOMEMORY, rb_exc_raise(), rb_thread_raised_clear, rb_thread_raised_p, rb_thread_raised_set, and TAG_RAISE.
Referenced by gc_heap_prepare_minimum_pages(), gc_profile_clear(), heap_page_allocate(), heap_pages_expand_sorted(), heap_prepare_freepage(), newobj_of(), nsdr(), readline_attempted_completion_function(), ruby_memerror(), ruby_memerror_body(), and stack_chunk_alloc().
VALUE rb_newobj | ( | void | ) |
Definition at line 1348 of file gc.c.
References newobj_of(), and T_NONE.
Definition at line 1354 of file gc.c.
References newobj_of().
Definition at line 1360 of file gc.c.
References FL_WB_PROTECTED, nd_set_type, newobj_of(), NODE_CREF, RGENGC_WB_PROTECTED_NODE_CREF, T_NODE, and type.
Definition at line 4851 of file gc.c.
References GET_HEAP_MARK_BITS, GET_HEAP_REMEMBERSET_BITS, I, MARKED_IN_BITMAP, max(), OBJ_WB_PROTECTED, RVALUE_INFANT_P(), and RVALUE_OLD_P().
Referenced by dump_object(), and Init_objspace_dump().
Definition at line 2376 of file gc.c.
References FIXNUM_FLAG, FLONUM_P, LONG2NUM, nonspecial_obj_id, SIGNED_VALUE, SPECIAL_CONST_P, SYM2ID, and SYMBOL_P.
Referenced by exec_recursive(), Init_GC(), iow_internal_object_id(), rb_exec_recursive_paired(), rb_exec_recursive_paired_outer(), and rb_obj_hash().
size_t rb_obj_memsize_of | ( | VALUE | obj | ) |
Definition at line 2551 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 4845 of file gc.c.
References OBJ_PROMOTED, Qfalse, and Qtrue.
Definition at line 4839 of file gc.c.
References OBJ_WB_PROTECTED, Qfalse, and Qtrue.
rb_objspace_t* rb_objspace_alloc | ( | void | ) |
Definition at line 873 of file gc.c.
References gc_params, malloc, malloc_limit, ruby_gc_params_t::malloc_limit_min, ruby_gc_stress, and ruby_initial_gc_stress.
Referenced by Init_BareVM().
|
static |
Definition at line 2150 of file gc.c.
References assert, ATOMIC_EXCHANGE, ATOMIC_SET, BUILTIN_TYPE, DATA_PTR, during_gc, finalize_deferred(), finalize_list(), finalizer_table, finalizing, force_chain_object(), gc_rest_sweep(), heap_pages_deferred_final, heap_pages_sorted, heap_pages_used, list, make_deferred(), make_io_deferred(), force_finalize_list::next, force_finalize_list::obj, 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 1383 of file gc.c.
References RTYPEDDATA_DATA, RTYPEDDATA_P, and RTYPEDDATA_TYPE.
Referenced by obj_memsize_of().
Definition at line 1394 of file gc.c.
References RTYPEDDATA_P, and RTYPEDDATA_TYPE.
Referenced by cto_i(), and type_name().
void rb_objspace_each_objects | ( | each_obj_callback * | callback, |
void * | data | ||
) |
Definition at line 1761 of file gc.c.
References callback(), each_obj_args::callback, each_obj_args::data, gc_rest_sweep(), lazy_sweep_enable(), objspace_each_objects(), Qnil, rb_ensure(), rb_objspace, and TRUE.
Referenced by count_nodes(), count_objects_size(), count_tdata_objects(), memsize_of_all_m(), objspace_dump_all(), and os_obj_of().
void rb_objspace_free | ( | rb_objspace_t * | objspace | ) |
Definition at line 890 of file gc.c.
References rb_objspace::eden_heap, free(), free_stack_chunks(), gc_rest_sweep(), global_List, heap_page_free(), heap_pages_himem, heap_pages_length, heap_pages_lomem, heap_pages_sorted, heap_pages_used, list, rb_objspace::mark_stack, gc_list::next, NULL, rb_heap_struct::page_length, rb_heap_struct::pages, rb_objspace::profile, rb_objspace::records, rb_heap_struct::total_slots, and xfree().
Referenced by ruby_vm_destruct().
int rb_objspace_internal_object_p | ( | VALUE | obj | ) |
Definition at line 1810 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 2281 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().
Definition at line 5782 of file gc.c.
References func, gc_mark_children(), is_markable_object(), rb_objspace::mark_func_data, objspace_and_reason::objspace, and rb_objspace.
Referenced by dump_object(), 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 5810 of file gc.c.
References root_objects_data::category, root_objects_data::data, func, root_objects_data::func, gc_mark_roots(), rb_objspace::mark_func_data, rb_objspace, root_objects_from(), and TRUE.
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 1265 of file gc.c.
References 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().
size_t rb_str_memsize | ( | VALUE | ) |
Definition at line 953 of file string.c.
References ELTS_SHARED, FL_TEST, STR_HEAP_SIZE, and STR_NOEMBED.
Referenced by obj_memsize_of().
Definition at line 1911 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().
|
static |
Definition at line 5050 of file gc.c.
References heap_eden, and heap_ready_to_gc().
Referenced by garbage_collect().
|
static |
Definition at line 3563 of file gc.c.
References gc_marked(), rb_objspace::parent_object_is_old, rb_objspace::remembered_shady_object_count, rb_objspace::rgengc, rgengc_remember(), RVALUE_INFANT_P(), RVALUE_OLD_P(), RVALUE_PROMOTE_INFANT(), and RVALUE_WB_PROTECTED.
Referenced by gc_mark(), and gc_mark_children().
|
static |
Definition at line 4720 of file gc.c.
References heap_page::heap, HEAP_BITMAP_SIZE, heap_page::mark_bits, heap_page::next, rb_heap_struct::pages, and heap_page::rememberset_bits.
Referenced by gc_marks_body().
|
static |
Definition at line 4603 of file gc.c.
References BUILTIN_TYPE, obj_type_name(), rb_objspace::profile, rb_bug(), rb_objspace::remembered_shady_object_count, RGENGC_PROFILE, rgengc_remembered(), rgengc_remembersetbits_get(), rgengc_remembersetbits_set(), rgengc_report, RVALUE_WB_PROTECTED, T_NONE, and T_ZOMBIE.
Referenced by rb_gc_writebarrier(), rb_gc_writebarrier_remember_promoted(), rb_gc_writebarrier_unprotect_promoted(), and rgengc_check_relation().
|
static |
Definition at line 4645 of file gc.c.
References check_gen_consistency(), obj_type_name(), result, rgengc_remembersetbits_get(), and rgengc_report.
Referenced by gc_page_sweep(), newobj_of(), rb_gc_writebarrier(), rb_gc_writebarrier_unprotect_promoted(), and rgengc_remember().
|
static |
Definition at line 4654 of file gc.c.
References BITS_BITLENGTH, CLEAR_IN_BITMAP, gc_mark_children(), gc_mark_ptr(), gc_prof_record, heap_page::heap, HEAP_BITMAP_LIMIT, heap_page::next, NUM_IN_PAGE, obj_type_name(), rb_heap_struct::pages, PRIdSIZE, heap_page::rememberset_bits, rgengc_report, RVALUE_INFANT_P(), RVALUE_PROMOTE_INFANT(), RVALUE_WB_PROTECTED, and heap_page::start.
Referenced by gc_marks_body().
|
static |
Definition at line 4580 of file gc.c.
References GET_HEAP_REMEMBERSET_BITS, and MARKED_IN_BITMAP.
Referenced by rgengc_remember(), and rgengc_remembered().
|
static |
Definition at line 4587 of file gc.c.
References FALSE, GET_HEAP_REMEMBERSET_BITS, MARK_IN_BITMAP, MARKED_IN_BITMAP, and TRUE.
Referenced by rgengc_remember().
|
static |
Definition at line 4552 of file gc.c.
References buf, during_gc, rb_objspace::during_minor_gc, level, rb_objspace::rgengc, RGENGC_DEBUG, and vsnprintf.
|
static |
Definition at line 4801 of file gc.c.
References rgengc_unprotect_logging_exit_func_i(), rgengc_unprotect_logging_table, and st_foreach().
Referenced by rb_gc_unprotect_logging().
Definition at line 4794 of file gc.c.
References key, ST_CONTINUE, and val.
Referenced by rgengc_unprotect_logging_exit_func().
|
static |
Definition at line 5803 of file gc.c.
References root_objects_data::data.
Referenced by rb_objspace_reachable_objects_from_root().
void ruby_gc_set_params | ( | int | safe_level | ) |
Definition at line 5736 of file gc.c.
References gc_params, gc_set_initial_pages(), get_envparam_double(), get_envparam_int(), 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_init_slots, ruby_gc_params_t::malloc_limit_growth_factor, ruby_gc_params_t::malloc_limit_max, ruby_gc_params_t::malloc_limit_min, objspace_and_reason::objspace, 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(), and rb_objspace::rgengc.
Referenced by process_options(), and rb_gc_set_params().
int ruby_get_stack_grow_direction | ( | volatile VALUE * | addr | ) |
Definition at line 3242 of file gc.c.
References ruby_stack_grow_direction, and SET_MACHINE_STACK_END.
|
static |
Definition at line 5867 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 6237 of file gc.c.
References objspace_xfree(), and size.
Referenced by 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 6203 of file gc.c.
References new_size(), and 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 6218 of file gc.c.
References objspace_xrealloc(), rb_eArgError, rb_raise(), and size.
Referenced by ruby_xrealloc2(), wmap_aset_update(), and wmap_final_func().
void* ruby_xcalloc | ( | size_t | n, |
size_t | size | ||
) |
Definition at line 6194 of file gc.c.
References objspace_xcalloc(), and size.
Referenced by getifaddrs(), and rb_iseq_defined_string().
void ruby_xfree | ( | void * | x | ) |
Definition at line 6245 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(), env_free(), fbuffer_free(), free_keys_i(), free_sdbm(), free_values_i(), freeifaddrs(), freeobj_i(), getifaddrs(), Init_dl(), Init_fiddle(), inst_free(), iseq_free(), JSON_free(), location_free(), mutex_free(), ossl_cipher_free(), ossl_hmac_free(), proc_free(), rb_dl_free(), rb_fiddle_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 6159 of file gc.c.
References objspace_xmalloc(), and size.
Referenced by bt_init(), dln_load(), getifaddrs(), make_unique_str(), newobj_i(), rb_dl_malloc(), rb_dlptr_malloc(), rb_fiddle_malloc(), and rb_fiddle_ptr_malloc().
void* ruby_xmalloc2 | ( | size_t | n, |
size_t | size | ||
) |
Definition at line 6175 of file gc.c.
References objspace_xmalloc(), size, and xmalloc2_size().
Referenced by wmap_aset_update().
void* ruby_xrealloc | ( | void * | ptr, |
size_t | new_size | ||
) |
Definition at line 6209 of file gc.c.
References new_size(), and ruby_sized_xrealloc().
Referenced by iseq_set_sequence(), rb_dl_realloc(), rb_fiddle_realloc(), and zstream_expand_buffer_without_gvl().
void* ruby_xrealloc2 | ( | void * | ptr, |
size_t | n, | ||
size_t | size | ||
) |
Definition at line 6228 of file gc.c.
References ruby_sized_xrealloc2(), and size.
|
static |
Definition at line 2048 of file gc.c.
References DATA_PTR, finalizer_table, heap_pages_final_slots, key, RBASIC_CLEAR_CLASS, RDATA, RTYPEDDATA_P, RTYPEDDATA_TYPE, run_finalizer(), st_data_t, and st_delete().
Referenced by finalize_list().
|
static |
Definition at line 2021 of file gc.c.
References FIX2INT, nonspecial_obj_id, Qnil, RARRAY_AREF, RARRAY_LEN, rb_ary_new3, rb_obj_freeze(), rb_protect(), rb_safe_level, rb_set_errinfo(), and run_single_final().
Referenced by rb_objspace_call_finalizer(), and run_final().
Definition at line 2013 of file gc.c.
References Qnil, and rb_eval_cmd().
Referenced by run_finalizer().
|
inlinestatic |
Definition at line 854 of file gc.c.
References check_gen_consistency(), CLEAR_IN_BITMAP, FL_PROMOTED, FL_UNSET2, GET_HEAP_OLDGEN_BITS, obj_type_name(), rb_bug(), RGENGC_CHECK_MODE, and RVALUE_OLD_P().
Referenced by rb_gc_writebarrier_unprotect_promoted().
Definition at line 756 of file gc.c.
References check_gen_consistency(), FL_PROMOTED, and FL_TEST2.
Referenced by gc_mark_children(), rb_obj_gc_flags(), rgengc_check_relation(), rgengc_rememberset_mark(), and RVALUE_PROMOTE_INFANT().
Definition at line 763 of file gc.c.
References check_gen_consistency(), and RVALUE_OLDGEN_BITMAP.
Referenced by rb_gc_writebarrier(), and RVALUE_OLD_P().
Definition at line 770 of file gc.c.
References check_gen_consistency(), FL_PROMOTED, FL_TEST2, and RVALUE_OLD_BITMAP_P().
Referenced by gc_page_sweep(), rb_gc_writebarrier(), rb_gc_writebarrier_unprotect_promoted(), rb_obj_gc_flags(), rgengc_check_relation(), RVALUE_DEMOTE_FROM_OLD(), verify_internal_consistency_i(), and verify_internal_consistency_reachable_i().
|
inlinestatic |
Definition at line 788 of file gc.c.
References BUILTIN_TYPE, check_gen_consistency(), FL_PROMOTED, FL_SET2, GET_HEAP_OLDGEN_BITS, MARK_IN_BITMAP, obj_type_name(), rb_objspace::profile, rb_bug(), rb_objspace, RGENGC_CHECK_MODE, and RVALUE_INFANT_P().
Referenced by gc_mark_children(), rgengc_check_relation(), and rgengc_rememberset_mark().
Definition at line 781 of file gc.c.
References check_gen_consistency(), FL_PROMOTED, and FL_TEST2.
Referenced by newobj_of(), rb_gc_writebarrier(), and rb_gc_writebarrier_unprotect_promoted().
Definition at line 2557 of file gc.c.
References hash(), INT2FIX, key, rb_hash_aset(), and ST_CONTINUE.
Referenced by count_objects().
|
static |
Definition at line 1922 of file gc.c.
References rb_eArgError, rb_intern, rb_obj_classname(), rb_obj_respond_to(), rb_raise(), and TRUE.
Referenced by define_final(), and rb_define_finalizer().
|
static |
Definition at line 1930 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 3119 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 3263 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 3093 of file gc.c.
References malloc, and rb_memerror().
Referenced by init_mark_stack(), and push_mark_stack_chunk().
Definition at line 7318 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_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, type, and TYPE_NAME.
Referenced by obj_type_name().
|
static |
Definition at line 4197 of file gc.c.
References is_live_object(), verify_internal_consistency_struct::objspace, verify_internal_consistency_struct::parent, rb_objspace_reachable_objects_from(), RVALUE_OLD_P(), and verify_internal_consistency_reachable_i().
Referenced by gc_verify_internal_consistency().
|
static |
Definition at line 4179 of file gc.c.
References assert, verify_internal_consistency_struct::err_count, GET_HEAP_PAGE, MARKED_IN_BITMAP, obj_type_name(), verify_internal_consistency_struct::parent, and RVALUE_OLD_P().
Referenced by verify_internal_consistency_i().
Definition at line 6393 of file gc.c.
References weakmap::final, ID2SYM, weakmap::obj2wmap, rb_intern, rb_obj_method(), st_init_numtable(), TypedData_Make_Struct, weakmap_type, and weakmap::wmap2obj.
Referenced by Init_GC().
Definition at line 6665 of file gc.c.
References is_id_value(), is_live_object(), Qnil, rb_objspace, st_data_t, st_lookup(), TypedData_Get_Struct, weakmap_type, and weakmap::wmap2obj.
Referenced by Init_GC(), and wmap_has_key().
Definition at line 6649 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_type, weakmap::wmap2obj, and wmap_aset_update().
Referenced by Init_GC().
|
static |
Definition at line 6627 of file gc.c.
References ruby_sized_xrealloc2(), ruby_xmalloc2(), size, ST_CONTINUE, st_data_t, ST_STOP, and val.
Referenced by wmap_aset().
Definition at line 6516 of file gc.c.
References rb_objspace, st_data_t, st_foreach(), TypedData_Get_Struct, weakmap_type, weakmap::wmap2obj, and wmap_each_i().
Referenced by Init_GC().
Definition at line 6504 of file gc.c.
References is_id_value(), is_live_object(), key, rb_yield_values(), ST_CONTINUE, and val.
Referenced by wmap_each().
Definition at line 6539 of file gc.c.
References rb_objspace, st_data_t, st_foreach(), TypedData_Get_Struct, weakmap_type, weakmap::wmap2obj, and wmap_each_key_i().
Referenced by Init_GC().
Definition at line 6527 of file gc.c.
References is_id_value(), is_live_object(), key, rb_yield(), ST_CONTINUE, and val.
Referenced by wmap_each_key().
Definition at line 6562 of file gc.c.
References rb_objspace, st_data_t, st_foreach(), TypedData_Get_Struct, weakmap_type, weakmap::wmap2obj, and wmap_each_value_i().
Referenced by Init_GC().
Definition at line 6550 of file gc.c.
References is_id_value(), is_live_object(), rb_yield(), ST_CONTINUE, and val.
Referenced by wmap_each_value().
|
static |
Definition at line 6404 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 6427 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_type, weakmap::wmap2obj, and wmap_final_func().
Referenced by Init_GC().
|
static |
Definition at line 6353 of file gc.c.
References weakmap::obj2wmap, st_foreach(), st_free_table(), weakmap::wmap2obj, and wmap_free_map().
Definition at line 6345 of file gc.c.
References ruby_sized_xfree(), ST_CONTINUE, and val.
Referenced by wmap_free().
Definition at line 6487 of file gc.c.
References CLASS_OF, PRIsVALUE, rb_class_name(), rb_sprintf(), rb_str_cat2(), RSTRING_PTR, st_foreach(), TypedData_Get_Struct, weakmap_type, weakmap::wmap2obj, and wmap_inspect_i().
Referenced by Init_GC().
Definition at line 6463 of file gc.c.
References key, 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 6587 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_type, weakmap::wmap2obj, and wmap_keys_i().
Referenced by Init_GC().
Definition at line 6573 of file gc.c.
References is_id_value(), is_live_object(), key, wmap_iter_arg::objspace, rb_ary_push(), ST_CONTINUE, val, and wmap_iter_arg::value.
Referenced by wmap_keys().
|
static |
Definition at line 6335 of file gc.c.
References weakmap::final, weakmap::obj2wmap, rb_gc_mark(), st_data_t, and st_foreach().
|
static |
Definition at line 6370 of file gc.c.
References weakmap::obj2wmap, size, st_data_t, st_foreach(), st_memsize(), weakmap::wmap2obj, and wmap_memsize_map().
Definition at line 6362 of file gc.c.
References ST_CONTINUE, and val.
Referenced by wmap_memsize().
Definition at line 6688 of file gc.c.
References st_table::num_entries, TypedData_Get_Struct, ULONG2NUM, weakmap_type, and weakmap::wmap2obj.
Referenced by Init_GC().
Definition at line 6614 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_type, weakmap::wmap2obj, and wmap_values_i().
Referenced by Init_GC().
Definition at line 6600 of file gc.c.
References is_id_value(), is_live_object(), wmap_iter_arg::objspace, rb_ary_push(), ST_CONTINUE, val, and wmap_iter_arg::value.
Referenced by wmap_values().
|
inlinestatic |
Definition at line 6165 of file gc.c.
References rb_eArgError, rb_raise(), and size.
Referenced by objspace_xcalloc(), and ruby_xmalloc2().
|
static |
Definition at line 152 of file gc.c.
Referenced by gc_before_sweep(), gc_marks(), gc_set_initial_pages(), heap_set_increment(), Init_heap(), rb_objspace_alloc(), and ruby_gc_set_params().
|
static |
Definition at line 4791 of file gc.c.
Referenced by rb_gc_unprotect_logging(), and rgengc_unprotect_logging_exit_func().
int ruby_disable_gc_stress = 0 |
Definition at line 650 of file gc.c.
Referenced by garbage_collect_body(), gc_prof_setup_new_record(), newobj_of(), and objspace_malloc_increase().
VALUE* ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress |
Definition at line 601 of file gc.c.
Referenced by set_debug_option().
int ruby_stack_grow_direction |
Definition at line 3240 of file gc.c.
Referenced by ruby_get_stack_grow_direction().
|
static |
Definition at line 6382 of file gc.c.
Referenced by wmap_allocate(), wmap_aref(), wmap_aset(), wmap_each(), wmap_each_key(), wmap_each_value(), wmap_finalize(), wmap_inspect(), wmap_keys(), wmap_size(), and wmap_values().