From f67a3fd05c1b2fe8c749fc2f58287b1b14b011d8 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 4 Aug 2023 22:38:48 +0100 Subject: move M to its own file --- vm.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'vm.c') diff --git a/vm.c b/vm.c index c420774..a9610d2 100644 --- a/vm.c +++ b/vm.c @@ -6,22 +6,9 @@ #include "val.h" #include "vm.h" +#include "mem.h" #include "dis.h" -void *M(void *p, size_t sz) { - if (sz == 0) { - free(p); - return NULL; - } else { - void *x = realloc(p, sz); - if (x == NULL) { - printf("out of memory! aaaaaaa!!!!!\n"); - exit(42); - } - return x; - } -} - Chunk chunk_new() { return (Chunk){ -- cgit v1.2.3