Skip to content

Commit 7614cbe

Browse files
authored
Merge pull request #5 from mmtk/mmtk-bug
Include some basic info on MMTk on crashes
2 parents 84c6ecc + 06ff591 commit 7614cbe

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

vm_dump.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
#include "vm_core.h"
3838
#include "ractor_core.h"
3939

40+
#ifdef USE_THIRD_PARTY_HEAP
41+
#include "mmtk.h"
42+
#endif
43+
4044
#define MAX_POSBUF 128
4145

4246
#define VM_CFP_CNT(ec, cfp) \
@@ -1189,6 +1193,16 @@ rb_vm_bugreport(const void *ctx)
11891193
}
11901194
#endif
11911195
}
1196+
1197+
#ifdef USE_THIRD_PARTY_HEAP
1198+
fprintf(stderr, "* MMTk:\n\n");
1199+
fprintf(stderr, " mmtk_free_bytes: %zu\n", mmtk_free_bytes());
1200+
fprintf(stderr, " mmtk_total_bytes: %zu\n", mmtk_total_bytes());
1201+
fprintf(stderr, " mmtk_used_bytes: %zu\n", mmtk_used_bytes());
1202+
fprintf(stderr, " mmtk_starting_heap_address: 0x%zx\n", (size_t) mmtk_starting_heap_address());
1203+
fprintf(stderr, " mmtk_last_heap_address: 0x%zx\n", (size_t) mmtk_last_heap_address());
1204+
fprintf(stderr, "\n");
1205+
#endif
11921206
}
11931207

11941208
void

0 commit comments

Comments
 (0)