diff options
| author | Franklin Wei <frankhwei536@gmail.com> | 2015-02-28 20:47:52 -0500 |
|---|---|---|
| committer | Franklin Wei <frankhwei536@gmail.com> | 2015-02-28 20:47:52 -0500 |
| commit | 8c3e1028de38c5ab6fc42879bf7b61a4dcc7112e (patch) | |
| tree | a6cf03d9f5fd13cd9959cf92981270713b1001c6 | |
| parent | 2892f3067b7d93527c07a81896a45d898982418b (diff) | |
| download | kappa-8c3e1028de38c5ab6fc42879bf7b61a4dcc7112e.zip kappa-8c3e1028de38c5ab6fc42879bf7b61a4dcc7112e.tar.gz kappa-8c3e1028de38c5ab6fc42879bf7b61a4dcc7112e.tar.bz2 kappa-8c3e1028de38c5ab6fc42879bf7b61a4dcc7112e.tar.xz | |
make libc malloc use kmalloc
| -rw-r--r-- | libc/stdlib.c | 13 |
1 files changed, 1 insertions, 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 <stddef.h> #include <stdint.h> #include <stdlib.h> +#include "heap.h" #include "panic.h" /* adapted from <http://www.strudel.org.uk/itoa/> */ @@ -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) |