diff options
author | Nathan Ringo <nathan@remexre.com> | 2024-11-27 20:28:40 -0600 |
---|---|---|
committer | Nathan Ringo <nathan@remexre.com> | 2024-11-27 20:28:40 -0600 |
commit | b252d0de46cf12b8e2521b3eb42da9acc41a4cc1 (patch) | |
tree | 456bfed5547745edacebe8c89194c26f03a25908 /src/util.c | |
parent | 62e41dcb40d0450d493a804e7f0ac3e32f35aabf (diff) |
new simpler GC
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -1,11 +1,13 @@ #include "util.h" +#include "gc.h" #include "platform.h" #include <stdarg.h> #include <stdio.h> noreturn void assume__failed(const char *file, int line, const char *expr) { panic_begin(); - fprintf(stderr, "%s:%d: assertion failed: %s\n", file, line, expr); + fprintf(stderr, "%s:%d: assertion failed: %s\n\n", file, line, expr); + gc_debug(); panic_end(); } @@ -16,5 +18,20 @@ noreturn void todo__impl(const char *file, int line, const char *fmt, ...) { va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); + printf("\n"); + gc_debug(); + panic_end(); +} + +noreturn void unreachable__impl(const char *file, int line, const char *fmt, + ...) { + panic_begin(); + printf("%s:%d: unreachable code entered: ", file, line); + va_list ap; + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + printf("\n"); + gc_debug(); panic_end(); } |