Add rb_gc_print_backtrace

This commit is contained in:
Peter Zhu 2026-01-03 09:27:15 -05:00
parent 65f9c4a06a
commit 5b87294d2f
Notes: git 2026-01-03 15:43:53 +00:00
2 changed files with 9 additions and 0 deletions

8
gc.c
View File

@ -129,6 +129,14 @@
#include "builtin.h"
#include "shape.h"
// TODO: Don't export this function in modular GC, instead MMTk should figure out
// how to combine GC thread backtrace with mutator thread backtrace.
void
rb_gc_print_backtrace(void)
{
rb_print_backtrace(stderr);
}
unsigned int
rb_gc_vm_lock(const char *file, int line)
{

View File

@ -108,6 +108,7 @@ MODULAR_GC_FN void rb_gc_initialize_vm_context(struct rb_gc_vm_context *context)
MODULAR_GC_FN void rb_gc_worker_thread_set_vm_context(struct rb_gc_vm_context *context);
MODULAR_GC_FN void rb_gc_worker_thread_unset_vm_context(struct rb_gc_vm_context *context);
MODULAR_GC_FN void rb_gc_move_obj_during_marking(VALUE from, VALUE to);
MODULAR_GC_FN void rb_gc_print_backtrace();
#endif
#if USE_MODULAR_GC