Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
Functions
gc.h File Reference

Public APIs related to rb_mGC. More...

#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"
#include "ruby/backward/2/attributes.h"

Go to the source code of this file.

Functions

void rb_memerror (void)
 
int rb_during_gc (void)
 
void rb_gc_mark_locations (const VALUE *, const VALUE *)
 
void rb_mark_tbl (struct st_table *)
 
void rb_mark_tbl_no_pin (struct st_table *)
 
void rb_mark_set (struct st_table *)
 
void rb_mark_hash (struct st_table *)
 
void rb_gc_update_tbl_refs (st_table *ptr)
 
void rb_gc_mark_maybe (VALUE)
 
void rb_gc_mark (VALUE)
 
void rb_gc_mark_movable (VALUE)
 
VALUE rb_gc_location (VALUE)
 
void rb_gc_force_recycle (VALUE)
 
void rb_gc (void)
 
void rb_gc_copy_finalizer (VALUE, VALUE)
 
VALUE rb_gc_enable (void)
 
VALUE rb_gc_disable (void)
 
VALUE rb_gc_start (void)
 
VALUE rb_define_finalizer (VALUE, VALUE)
 
VALUE rb_undefine_finalizer (VALUE)
 
size_t rb_gc_count (void)
 
size_t rb_gc_stat (VALUE)
 
VALUE rb_gc_latest_gc_info (VALUE)
 
void rb_gc_adjust_memory_usage (ssize_t)
 

Detailed Description

Public APIs related to rb_mGC.

Author
Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org
Warning
Symbols prefixed with either RBIMPL or rbimpl are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will.
Note
To ruby-core: remember that this header can be possibly recursively included from extension libraries written in C++. Do not expect for instance __VA_ARGS__ is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98.

Definition in file gc.h.

Function Documentation

◆ rb_define_finalizer()

VALUE rb_define_finalizer ( VALUE  obj,
VALUE  block 
)

Definition at line 3604 of file gc.c.

◆ rb_during_gc()

int rb_during_gc ( void  )

Definition at line 9505 of file gc.c.

References during_gc, and rb_objspace.

Referenced by rb_ec_stack_overflow().

◆ rb_gc()

void rb_gc ( void  )

Definition at line 9497 of file gc.c.

References GPR_DEFAULT_REASON, and rb_objspace.

Referenced by rb_fdopen(), rb_gc_for_fd(), rb_gc_start(), rb_reg_region_copy(), and rsock_s_accept().

◆ rb_gc_adjust_memory_usage()

void rb_gc_adjust_memory_usage ( ssize_t  diff)

Definition at line 11062 of file gc.c.

References MEMOP_TYPE_REALLOC, and rb_objspace.

◆ rb_gc_copy_finalizer()

void rb_gc_copy_finalizer ( VALUE  dest,
VALUE  obj 
)

Definition at line 3612 of file gc.c.

References finalizer_table, FL_FINALIZE, FL_SET, FL_TEST, rb_objspace, st_insert, and st_lookup.

◆ rb_gc_count()

size_t rb_gc_count ( void  )

Definition at line 9529 of file gc.c.

References rb_objspace::count, and rb_objspace::profile.

◆ rb_gc_disable()

VALUE rb_gc_disable ( void  )

Definition at line 9925 of file gc.c.

References rb_objspace, and rb_objspace_gc_disable().

◆ rb_gc_enable()

VALUE rb_gc_enable ( void  )

Definition at line 9888 of file gc.c.

References rb_objspace, and rb_objspace_gc_enable().

◆ rb_gc_force_recycle()

void rb_gc_force_recycle ( VALUE  obj)

◆ rb_gc_latest_gc_info()

VALUE rb_gc_latest_gc_info ( VALUE  key)

Definition at line 9634 of file gc.c.

References key, and rb_objspace.

◆ rb_gc_location()

VALUE rb_gc_location ( VALUE  value)

◆ rb_gc_mark()

void rb_gc_mark ( VALUE  ptr)

◆ rb_gc_mark_locations()

void rb_gc_mark_locations ( const VALUE start,
const VALUE end 
)

Definition at line 5580 of file gc.c.

References heap_page::start.

Referenced by rb_execution_context_mark().

◆ rb_gc_mark_maybe()

void rb_gc_mark_maybe ( VALUE  obj)

Definition at line 5931 of file gc.c.

Referenced by rb_gvar_var_marker().

◆ rb_gc_mark_movable()

void rb_gc_mark_movable ( VALUE  ptr)

Definition at line 6106 of file gc.c.

References ptr.

Referenced by rb_execution_context_mark(), rb_fiber_mark_self(), rb_gvar_val_marker(), rb_iseq_mark(), and rb_vm_mark().

◆ rb_gc_start()

VALUE rb_gc_start ( void  )

Definition at line 9490 of file gc.c.

References Qnil, and rb_gc().

◆ rb_gc_stat()

size_t rb_gc_stat ( VALUE  key)

Definition at line 9853 of file gc.c.

References key, and SYMBOL_P.

◆ rb_gc_update_tbl_refs()

void rb_gc_update_tbl_refs ( st_table ptr)

Definition at line 8850 of file gc.c.

References ptr, and rb_objspace.

Referenced by rb_vm_update_references().

◆ rb_mark_hash()

void rb_mark_hash ( struct st_table tbl)

Definition at line 5750 of file gc.c.

◆ rb_mark_set()

void rb_mark_set ( struct st_table tbl)

Definition at line 5686 of file gc.c.

Referenced by rb_iseq_build_from_ary().

◆ rb_mark_tbl()

void rb_mark_tbl ( struct st_table tbl)

Definition at line 5893 of file gc.c.

Referenced by rb_vm_mark().

◆ rb_mark_tbl_no_pin()

void rb_mark_tbl_no_pin ( struct st_table tbl)

Definition at line 5899 of file gc.c.

◆ rb_memerror()

void rb_memerror ( void  )

◆ rb_undefine_finalizer()

VALUE rb_undefine_finalizer ( VALUE  obj)

Definition at line 3453 of file gc.c.

References finalizer_table, FL_FINALIZE, FL_UNSET, rb_check_frozen, rb_objspace, and st_delete.