12typedef struct MMTk_Builder MMTk_Builder;
13typedef struct MMTk_Mutator MMTk_Mutator;
18typedef void *MMTk_Address;
19typedef void *MMTk_ObjectReference;
20typedef void *MMTk_NullableObjectReference;
21typedef uint32_t MMTk_AllocationSemantics;
24#define MMTk_OBJREF_OFFSET 8
26#define MMTk_MIN_OBJ_ALIGN 8
28#define MMTk_GC_THREAD_KIND_WORKER 1
31 bool ractor_check_mode;
35typedef MMTk_ObjectReference (*MMTk_ObjectClosureFunction)(
void*,
void*, MMTk_ObjectReference, bool);
56 bool (*is_mutator)(void);
57 void (*stop_the_world)(void);
58 void (*resume_mutators)(void);
60 size_t (*number_of_mutators)(void);
61 void (*get_mutators)(void (*visit_mutator)(MMTk_Mutator*,
void*),
void *data);
62 void (*scan_gc_roots)(void);
63 void (*scan_objspace)(void);
66 void (*scan_object_ruby_style)(MMTk_ObjectReference object);
67 void (*call_gc_mark_children)(MMTk_ObjectReference object);
68 void (*call_obj_free)(MMTk_ObjectReference object);
69 size_t (*vm_live_bytes)(void);
70 void (*update_global_tables)(
int tbl_idx);
71 int (*global_tables_count)(void);
72 void (*update_finalizer_table)(void);
73 void (*update_obj_id_tables)(void);
77 MMTk_ObjectReference *ptr;
82bool mmtk_is_live_object(MMTk_ObjectReference
object);
84bool mmtk_is_reachable(MMTk_ObjectReference
object);
86MMTk_Builder *mmtk_builder_default(
void);
88void mmtk_init_binding(MMTk_Builder *builder,
91 MMTk_ObjectReference weak_reference_dead_value);
97void mmtk_destroy_mutator(MMTk_Mutator *mutator);
101void mmtk_set_gc_enabled(
bool enable);
103bool mmtk_gc_enabled_p(
void);
105MMTk_Address mmtk_alloc(MMTk_Mutator *mutator,
109 MMTk_AllocationSemantics semantics);
111void mmtk_post_alloc(MMTk_Mutator *mutator,
112 MMTk_ObjectReference refer,
114 MMTk_AllocationSemantics semantics);
116void mmtk_add_obj_free_candidate(MMTk_ObjectReference
object);
118void mmtk_mark_weak(MMTk_ObjectReference *ptr);
120void mmtk_remove_weak(
const MMTk_ObjectReference *ptr);
122void mmtk_object_reference_write_post(MMTk_Mutator *mutator, MMTk_ObjectReference
object);
124void mmtk_register_wb_unprotected_object(MMTk_ObjectReference
object);
126bool mmtk_object_wb_unprotected_p(MMTk_ObjectReference
object);
128void mmtk_enumerate_objects(
void (*callback)(MMTk_ObjectReference,
void*),
void *data);
134void mmtk_before_fork(
void);
138size_t mmtk_total_bytes(
void);
140size_t mmtk_used_bytes(
void);
142size_t mmtk_free_bytes(
void);
144MMTk_Address mmtk_starting_heap_address(
void);
146MMTk_Address mmtk_last_heap_address(
void);
148bool mmtk_is_mmtk_object(MMTk_Address addr);
void * rust_closure
The pointer to the Rust-level closure object.
MMTk_ObjectClosureFunction c_function
The function to be called from C.