From 226d861c9ebb7f09f95665d07d9ab5c6b7ed7d6f Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Thu, 3 Oct 2024 15:08:45 +0200 Subject: libc: small changes --- userland/libc/malloc/malloc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'userland/libc/malloc') diff --git a/userland/libc/malloc/malloc.c b/userland/libc/malloc/malloc.c index e368edd..bb7361d 100644 --- a/userland/libc/malloc/malloc.c +++ b/userland/libc/malloc/malloc.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -8,7 +9,7 @@ #include #include #include -#define NEW_ALLOC_SIZE 0x5000 +#define NEW_ALLOC_SIZE 0x20000 #define IS_FREE (1 << 0) #define IS_FINAL (1 << 1) @@ -37,6 +38,12 @@ int debug_vprintf(const char *fmt, va_list ap) { return -1; } write(1, buffer, rc); + + static int serial_fd = -1; + if (-1 == serial_fd) { + serial_fd = open("/dev/serial", O_RDWR); + } + write(serial_fd, buffer, rc); return rc; } @@ -259,6 +266,8 @@ void free(void *p) { assert(h->magic == 0xdde51ab9410268b1); assert(!(h->flags & IS_FREE)); + randomfill(p, h->size); + h->flags |= IS_FREE; merge_headers(h); } -- cgit v1.2.3