diff options
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -1,6 +1,5 @@ #include <u.h> #include <libc.h> -#include <thread.h> #include <bio.h> #include <pool.h> @@ -16,7 +15,7 @@ emalloc(ulong size) void *res = malloc(size); if(res == nil && size > 0){ print("Out of memory! :(\n"); - threadexitsall("emalloc"); + exits("emalloc"); } return res; } @@ -27,7 +26,7 @@ emallocz(ulong size, int clr) void *res = mallocz(size, clr); if(res == nil && size > 0){ print("Out of memory! :(\n"); - threadexitsall("emallocz"); + exits("emallocz"); } return res; } @@ -38,7 +37,7 @@ erealloc(void *ptr, ulong size) void *res = realloc(ptr, size); if(res == nil && size > 0){ print("Out of memory! :(\n"); - threadexitsall("erealloc"); + exits("erealloc"); } return res; } @@ -59,7 +58,7 @@ freearray(Array *a) return; if(GetRefs(a) == 0){ print("NEGATIVE REF COUNT (array)! %p\n", a); - threadexitsall(nil); + exits(nil); } SetRefs(a, GetRefs(a)-1); @@ -148,13 +147,13 @@ freedatum(Datum *d) break; default: print("Don't know how to free datum with tag: %d\n", d->tag); - threadexitsall("freedatum"); + exits("freedatum"); } free(d); datumalloccounts--; }else if(d->refs < 0){ print("NEGATIVE REF COUNT (datum)! %p\n", d); - threadexitsall(nil); + exits(nil); } } @@ -189,7 +188,7 @@ freefunction(Function f) break; default: print("Missing case in freefunction: %d\n", f.type); - threadexitsall("freefunction"); + exits("freefunction"); } } @@ -207,7 +206,7 @@ freeoperator(Operator o) break; default: print("Missing case in freeoperator: %d\n", o.type); - threadexitsall("freeoperator"); + exits("freeoperator"); } } @@ -250,7 +249,7 @@ dupfunction(Function f) break; default: print("Missing case in dupfunction: %d\n", f.type); - threadexitsall("dupfunction"); + exits("dupfunction"); } return g; @@ -273,7 +272,7 @@ dupoperator(Operator o) break; default: print("Missing case in dupoperator: %d\n", o.type); - threadexitsall("dupoperator"); + exits("dupoperator"); } return p; } |