From 8c3e1028de38c5ab6fc42879bf7b61a4dcc7112e Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sat, 28 Feb 2015 20:47:52 -0500 Subject: make libc malloc use kmalloc --- libc/stdlib.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/libc/stdlib.c b/libc/stdlib.c index 57b370c..4301618 100644 --- a/libc/stdlib.c +++ b/libc/stdlib.c @@ -2,6 +2,7 @@ #include #include #include +#include "heap.h" #include "panic.h" /* adapted from */ @@ -84,18 +85,6 @@ int abs(int val) void *malloc(size_t sz) { return kmalloc(sz); - static uint8_t mallocbuf[1024*1024*16]; - static uint8_t *next_ptr = mallocbuf; - static int bytes_left = sizeof(mallocbuf); - bytes_left -= sz; - if(bytes_left < 0) - return NULL; - else - { - void *ret = next_ptr; - next_ptr += sz; - return ret; - } } static inline int snputs(char *buf, int idx, int sz, const char *str) -- cgit v1.1