1 #ifndef RBIMPL_INTERN_GC_H
2 #define RBIMPL_INTERN_GC_H
23 #include "ruby/internal/config.h"
29 #ifdef HAVE_SYS_TYPES_H
30 # include <sys/types.h>
Defines RBIMPL_ATTR_COLD.
#define RBIMPL_ATTR_COLD()
Wraps (or simulates) __attribute__((cold))
#define RBIMPL_ATTR_DEPRECATED(msg)
Wraps (or simulates) [[deprecated]]
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
void rb_gc_mark(VALUE obj)
Marks an object.
void rb_mark_tbl_no_pin(struct st_table *tbl)
Identical to rb_mark_tbl(), except it marks objects using rb_gc_mark_movable().
void rb_memerror(void)
Triggers out-of-memory error.
size_t rb_gc_stat(VALUE key_or_buf)
Obtains various GC related profiles.
void rb_gc_mark_movable(VALUE obj)
Maybe this is the only function provided for C extensions to control the pinning of objects,...
VALUE rb_gc_disable(void)
Disables GC.
VALUE rb_gc_start(void)
Identical to rb_gc(), except the return value.
VALUE rb_gc_latest_gc_info(VALUE key_or_buf)
Obtains various info regarding the most recent GC run.
void rb_mark_tbl(struct st_table *tbl)
Identical to rb_mark_hash(), except it marks only values of the table and leave their associated keys...
VALUE rb_gc_enable(void)
(Re-) enables GC.
void rb_mark_hash(struct st_table *tbl)
Marks keys and values associated inside of the given table.
VALUE rb_undefine_finalizer(VALUE obj)
Modifies the object so that it has no finalisers at all.
int rb_during_gc(void)
Queries if the GC is busy.
void rb_gc_mark_maybe(VALUE obj)
Identical to rb_gc_mark(), except it allows the passed value be a non-object.
VALUE rb_gc_location(VALUE obj)
Finds a new "location" of an object.
void rb_gc_mark_locations(const VALUE *start, const VALUE *end)
Marks objects between the two pointers.
void rb_gc(void)
Triggers a GC process.
void rb_gc_force_recycle(VALUE obj)
Asserts that the passed object is no longer needed.
void rb_gc_update_tbl_refs(st_table *ptr)
Updates references inside of tables.
void rb_mark_set(struct st_table *tbl)
Identical to rb_mark_hash(), except it marks only keys of the table and leave their associated values...
VALUE rb_define_finalizer(VALUE obj, VALUE block)
Assigns a finaliser for an object.
void rb_gc_copy_finalizer(VALUE dst, VALUE src)
Copy&paste an object's finaliser to another.
void rb_gc_adjust_memory_usage(ssize_t diff)
Informs that there are external memory usages.
size_t rb_gc_count(void)
Identical to rb_gc_stat(), with "count" parameter.
RBIMPL_ATTR_NORETURN() void rb_eof_error(void)
Utility function to raise rb_eEOFError.
char * ptr
Pointer to the underlying memory region, of at least capa bytes.
RBIMPL_ATTR_PURE() int rb_io_read_pending(rb_io_t *fptr)
Queries if the passed IO has any pending reads.
Defines RBIMPL_ATTR_NONNULL.
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Defines RBIMPL_ATTR_NORETURN.
Defines RBIMPL_ATTR_PURE.
uintptr_t VALUE
Type that represents a Ruby object.