add nogc message to thrF
This commit is contained in:
parent
a03fab044d
commit
d930e7f975
@ -351,6 +351,7 @@ NOINLINE void print_fmt(char* p, ...) {
|
||||
decG(r);
|
||||
}
|
||||
NOINLINE void thrF(char* p, ...) {
|
||||
NOGC_CHECK("throwing during noAlloc");
|
||||
va_list a;
|
||||
va_start(a, p);
|
||||
B r = do_fmt(emptyCVec(), p, a);
|
||||
|
||||
4
src/h.h
4
src/h.h
@ -327,7 +327,7 @@ typedef struct Arr {
|
||||
#define UD assert(false)
|
||||
extern bool cbqn_noAlloc;
|
||||
NOINLINE void cbqn_NOGC_start(); // function to allow breakpointing
|
||||
#define NOGC_CHECK if (cbqn_noAlloc && !gc_depth) fatal("allocating during noalloc");
|
||||
#define NOGC_CHECK(M) do { if (cbqn_noAlloc && !gc_depth) fatal(M); } while (0)
|
||||
#define NOGC_S cbqn_NOGC_start()
|
||||
#define NOGC_E cbqn_noAlloc=false
|
||||
#else
|
||||
@ -337,7 +337,7 @@ typedef struct Arr {
|
||||
#define UD __builtin_unreachable()
|
||||
#define NOGC_S
|
||||
#define NOGC_E
|
||||
#define NOGC_CHECK
|
||||
#define NOGC_CHECK(M)
|
||||
#endif
|
||||
#if WARN_SLOW
|
||||
void warn_slow1(char* s, B x);
|
||||
|
||||
@ -23,7 +23,7 @@ extern EmptyValue* mm_buckets[64];
|
||||
#if !ALLOC_NOINLINE || ALLOC_IMPL || ALLOC_IMPL_MMX
|
||||
ALLOC_FN void* mm_alloc(u64 sz, u8 type) {
|
||||
assert(sz>=16);
|
||||
NOGC_CHECK;
|
||||
NOGC_CHECK("allocating during noalloc");
|
||||
preAlloc(sz, type);
|
||||
#if VERIFY_TAIL
|
||||
i64 logAlloc = LOG2(sz + VERIFY_TAIL);
|
||||
|
||||
@ -96,7 +96,7 @@ static void mut_copy(Mut* m, usz ms, B x, usz xs, usz l) { assert(isArr(x)); m->
|
||||
// after that, the only valid operation on the Mut will be MUT_APPEND
|
||||
// using this append system will no longer prevent allocations from being done during the lifetime of the Mut
|
||||
#define MUT_APPEND_INIT(N) ux N##_ci = 0; NOGC_E;
|
||||
#define MUT_APPEND(N, X, XS, L) ({ ux l_ = (L); NOGC_CHECK; \
|
||||
#define MUT_APPEND(N, X, XS, L) ({ ux l_ = (L); NOGC_CHECK("MUT_APPEND during noalloc"); \
|
||||
mut_copy(N, N##_ci, X, XS, l_); \
|
||||
N##_ci+= l_; \
|
||||
if (PTY(N->val) == t_harr) { NOGC_E; N->val->ia = N##_ci; } \
|
||||
|
||||
4
src/vm.c
4
src/vm.c
@ -1677,9 +1677,7 @@ void before_exit(void);
|
||||
NOINLINE NORETURN void throwImpl(bool rethrow) {
|
||||
// printf("gStack %p-%p:\n", gStackStart, gStack); B* c = gStack;
|
||||
// while (c>gStackStart) { printI(*--c); putchar('\n'); } printf("gStack printed\n");
|
||||
#if DEBUG
|
||||
if (cbqn_noAlloc && !gc_depth) fatal("throwing during noAlloc");
|
||||
#endif
|
||||
NOGC_CHECK("throwing during noAlloc");
|
||||
if (!rethrow) envPrevHeight = envCurr-envStart + 1;
|
||||
#if CATCH_ERRORS
|
||||
if (cf>cfStart) { // something wants to catch errors
|
||||
|
||||
Loading…
Reference in New Issue
Block a user