diff --git a/src/builtins/sysfn.c b/src/builtins/sysfn.c index 535fa64c..c1197309 100644 --- a/src/builtins/sysfn.c +++ b/src/builtins/sysfn.c @@ -91,7 +91,7 @@ B repr_c1(B t, B x) { if (isF64(x)) { #if NO_RYU NUM_FMT_BUF(buf, x.f); - return utf8Decode(buf, strlen(buf)); + return utf8Decode0(buf); #else return ryu_d2s(o2fG(x)); #endif diff --git a/src/core/heap.c b/src/core/heap.c index 92bf188b..d124d517 100644 --- a/src/core/heap.c +++ b/src/core/heap.c @@ -49,15 +49,15 @@ void mm_forFreedHeap(V2v f); void heap_printInfo(bool sizes, bool types, bool freed, bool chain) { u64 total = mm_heapAlloc; u64 used = mm_heapUsed(); - printf("RAM allocated: "N64u"\n", total); - printf("heap in use: "N64u"\n", used); + fprintf(stderr, "RAM allocated: "N64u"\n", total); + fprintf(stderr, "heap in use: "N64u"\n", used); #if MM!=0 if (sizes) { for (i32 i = 2; i < 64; i++) { for (i32 j = 0; j < MM; j++) { i32 o = i-j; u64 count = mm_ctrs[o + j*64]; - if (count>0) printf("size %llu: "N64u"\n", (1ULL<0) fprintf(stderr, "size %llu: "N64u"\n", (1ULL<0) printf("type %d/%s: count "N64u", total size "N64u"\n", i, type_repr(i), count, heap_PISizes[i]); + if (count>0) fprintf(stderr, "type %d/%s: count "N64u", total size "N64u"\n", i, type_repr(i), count, heap_PISizes[i]); } } if (freed || chain) { @@ -91,11 +91,12 @@ void heap_printInfo(bool sizes, bool types, bool freed, bool chain) { } } if (cf!=0 || cc!=0) { - if (chain && freed) printf("freed size %llu: count "N64u", chain "N64u"\n", (1ULL<" : ty==2? "[...]" : ty==U'˘'? "˘" : ty==U'⎉'? "⎉" : "??"; + return ty==1? ">" : ty==2? "[…]" : ty==U'˘'? "˘" : ty==U'⎉'? "⎉" : "??"; } Arr* apd_sh_err(ApdMut* m, u32 ty) { B msg = make_fmt("%U: Incompatible %S shapes (encountered shapes %2H and %H)", apd_ty_base(ty), ty>2? "result" : "element", m->cr, m->csh, m->failEl); diff --git a/src/vm.c b/src/vm.c index 7155e19e..31fda981 100644 --- a/src/vm.c +++ b/src/vm.c @@ -1296,7 +1296,7 @@ CatchFrame* cfStart; CatchFrame* cfEnd; #if CATCH_ERRORS -jmp_buf* prepareCatch() { // in the case of returning false, must call popCatch(); +jmp_buf* prepareCatch() { if (cf==cfEnd) { u64 n = cfEnd-cfStart; n = n<8? 8 : n*2; @@ -1727,7 +1727,7 @@ NOINLINE void freeThrown() { } NOINLINE NORETURN void thrM(char* s) { - thr(utf8Decode(s, strlen(s))); + thr(utf8Decode0(s)); } NOINLINE NORETURN void thrOOM() { if (oomMessage.u==0) err("out-of-memory encountered before out-of-memory error message object was initialized");