tiny changes

This commit is contained in:
dzaima 2021-03-30 12:53:26 +03:00
parent f534115d1c
commit 3773c15d90
2 changed files with 6 additions and 4 deletions

View File

@ -148,6 +148,7 @@ void print_vmStack();
B err(char* s) {
puts(s); fflush(stdout);
print_vmStack();
__builtin_trap();
exit(1);
}
@ -314,11 +315,12 @@ void dec(B x) {
mm_free(vx);
}
}
void ptr_dec(void* x) { dec(tag(x, OBJ_TAG)); }
bool reusable(B x) { return v(x)->refc==1; }
void inc (B x) { if (isVal(VALIDATE(x))) v(x)->refc++; }
B inci(B x) { inc(x); return x; }
void ptr_dec(void* x) { dec(tag(x, OBJ_TAG)); }
void ptr_inc(void* x) { inc(tag(x, OBJ_TAG)); }
bool reusable(B x) { return v(x)->refc==1; }
void ptr_inc(void* x) { ((Value*)x)->refc++; }
void printUTF8(u32 c);

View File

@ -150,7 +150,7 @@ int main() {
dec(comp);
#ifdef ALLOC_STAT
printf("total allocated: %lu\n", talloc);
printf("total bytes allocated: %lu\n", talloc);
printf("ctrA←"); for (i64 j = 0; j < Type_MAX; j++) { if(j)printf(""); printf("%lu", ctr_a[j]); } printf("\n");
printf("ctrF←"); for (i64 j = 0; j < Type_MAX; j++) { if(j)printf(""); printf("%lu", ctr_f[j]); } printf("\n");
for(i64 i = 0; i < actrc; i++) {