Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
Internal header for GC. More...
#include "ruby/internal/config.h"
#include <stddef.h>
#include "internal/compilers.h"
#include "ruby/ruby.h"
Go to the source code of this file.
Data Structures | |
struct | ractor_newobj_cache |
Macros | |
#define | RB_NEWOBJ_OF(var, T, c, f) |
#define | RB_EC_NEWOBJ_OF(ec, var, T, c, f) |
#define | NEWOBJ_OF(var, T, c, f) RB_NEWOBJ_OF((var), T, (c), (f)) |
#define | RB_OBJ_GC_FLAGS_MAX 6 /* used in ext/objspace */ |
#define | UNALIGNED_MEMBER_ACCESS(expr) (expr) |
#define | UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem) |
#define | RB_OBJ_WRITE(a, slot, b) |
#define | SIZED_REALLOC_N(v, T, m, n) ((v) = (T *)ruby_sized_xrealloc2((void *)(v), (m), sizeof(T), (n))) |
#define | ruby_sized_xrealloc ruby_sized_xrealloc_inlined |
#define | ruby_sized_xrealloc2 ruby_sized_xrealloc2_inlined |
#define | ruby_sized_xfree ruby_sized_xfree_inlined |
Typedefs | |
typedef struct ractor_newobj_cache | rb_ractor_newobj_cache_t |
Variables | |
VALUE * | ruby_initial_gc_stress_ptr |
int | ruby_disable_gc |
Internal header for GC.
Definition in file gc.h.
#define NEWOBJ_OF | ( | var, | |
T, | |||
c, | |||
f | |||
) | RB_NEWOBJ_OF((var), T, (c), (f)) |
#define RB_OBJ_WRITE | ( | a, | |
slot, | |||
b | |||
) |
#define SIZED_REALLOC_N | ( | v, | |
T, | |||
m, | |||
n | |||
) | ((v) = (T *)ruby_sized_xrealloc2((void *)(v), (m), sizeof(T), (n))) |
#define UNALIGNED_MEMBER_PTR | ( | ptr, | |
mem | |||
) | UNALIGNED_MEMBER_ACCESS(&(ptr)->mem) |
typedef struct ractor_newobj_cache rb_ractor_newobj_cache_t |
__attribute__ | ( | (__alloc_align__(1)) | ) |
Definition at line 2482 of file gc.c.
References heap_page::flags, Qundef, RGENGC_WB_PROTECTED_OBJECT, ROBJECT_EMBED, and T_OBJECT.
Definition at line 7876 of file gc.c.
References GET_HEAP_WB_UNPROTECTED_BITS, MARK_IN_BITMAP, and rb_objspace.
int rb_ec_stack_check | ( | struct rb_execution_context_struct * | ec | ) |
VALUE rb_ec_wb_protected_newobj_of | ( | struct rb_execution_context_struct * | ec, |
VALUE | klass, | ||
VALUE | flags | ||
) |
Definition at line 2356 of file gc.c.
References FL_WB_PROTECTED, heap_page::flags, GC_ASSERT, and TRUE.
Definition at line 5619 of file gc.c.
References rb_objspace.
Referenced by rb_execution_context_mark().
void rb_gc_ractor_newobj_cache_clear | ( | rb_ractor_newobj_cache_t * | newobj_cache | ) |
Definition at line 7937 of file gc.c.
References RVALUE::as, RVALUE::free, heap_page::freelist, ractor_newobj_cache::freelist, RVALUE::next, NULL, RUBY_DEBUG_LOG, and ractor_newobj_cache::using_page.
void rb_gc_writebarrier_remember | ( | VALUE | obj | ) |
Definition at line 7814 of file gc.c.
References gc_report, is_incremental_marking, and rb_objspace.
Referenced by rb_ary_cancel_sharing(), rb_hash_keys(), and rb_hash_values().
Definition at line 12499 of file gc.c.
Referenced by rb_raw_obj_info().
Definition at line 2534 of file gc.c.
Referenced by rb_raw_obj_info().
VALUE rb_objspace_gc_disable | ( | struct rb_objspace * | objspace | ) |
Definition at line 9932 of file gc.c.
Referenced by rb_gc_disable().
VALUE rb_objspace_gc_enable | ( | struct rb_objspace * | objspace | ) |
Definition at line 9895 of file gc.c.
References dont_gc_off, dont_gc_val, Qfalse, and Qtrue.
Referenced by Init_VM(), and rb_gc_enable().
void rb_objspace_set_event_hook | ( | const rb_event_flag_t | event | ) |
Definition at line 2052 of file gc.c.
References rb_objspace::flags, rb_objspace::has_hook, rb_objspace::hook_events, rb_objspace, and RUBY_INTERNAL_EVENT_OBJSPACE_MASK.
size_t rb_size_mul_add_or_raise | ( | size_t | x, |
size_t | y, | ||
size_t | z, | ||
VALUE | exc | ||
) |
Definition at line 2349 of file gc.c.
References FL_WB_PROTECTED, heap_page::flags, GC_ASSERT, and TRUE.
Definition at line 2342 of file gc.c.
References FALSE, FL_WB_PROTECTED, heap_page::flags, and GC_ASSERT.
RUBY_ATTR_MALLOC void * rb_xcalloc_mul_add_mul | ( | size_t | x, |
size_t | y, | ||
size_t | z, | ||
size_t | w | ||
) |
Definition at line 10941 of file gc.c.
References rb_eArgError, and ruby_xcalloc().
RUBY_ATTR_MALLOC void * rb_xmalloc_mul_add | ( | size_t | x, |
size_t | y, | ||
size_t | z | ||
) |
Definition at line 10920 of file gc.c.
References rb_eArgError, and ruby_xmalloc().
RUBY_ATTR_MALLOC void * rb_xmalloc_mul_add_mul | ( | size_t | x, |
size_t | y, | ||
size_t | z, | ||
size_t | w | ||
) |
Definition at line 10934 of file gc.c.
References rb_eArgError, and ruby_xmalloc().
void * rb_xrealloc_mul_add | ( | const void * | p, |
size_t | x, | ||
size_t | y, | ||
size_t | z | ||
) |
Definition at line 10927 of file gc.c.
References rb_eArgError, and ruby_xrealloc().
size_t RUBY_ATTR_ALLOC_SIZE | ( | (2) | ) |
void ruby_gc_set_params | ( | void | ) |
Definition at line 10122 of file gc.c.
References FALSE, ruby_gc_params_t::growth_factor, ruby_gc_params_t::growth_max_slots, ruby_gc_params_t::heap_free_slots, ruby_gc_params_t::heap_free_slots_goal_ratio, ruby_gc_params_t::heap_free_slots_max_ratio, ruby_gc_params_t::heap_free_slots_min_ratio, ruby_gc_params_t::heap_init_slots, ruby_gc_params_t::malloc_limit_growth_factor, ruby_gc_params_t::malloc_limit_max, ruby_gc_params_t::malloc_limit_min, 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_objspace::rgengc, SIZE_MAX, and TRUE.
void ruby_mimfree | ( | void * | ptr | ) |
RUBY_ATTR_MALLOC void * ruby_mimmalloc | ( | size_t | size | ) |
Definition at line 10951 of file gc.c.
References malloc, NULL, and malloc_obj_info::size.
Referenced by Init_BareVM(), rb_ractor_main_alloc(), and rb_threadptr_root_fiber_setup().
void * ruby_sized_xrealloc | ( | void * | ptr, |
size_t | new_size, | ||
size_t | old_size | ||
) |
void * ruby_sized_xrealloc2 | ( | void * | ptr, |
size_t | new_count, | ||
size_t | element_size, | ||
size_t | old_count | ||
) |
|
extern |
Definition at line 879 of file gc.c.
Referenced by ruby_env_debug_option().