From ce24526da5c66f1840721707023ae4ecab51486e Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Fri, 4 Feb 2022 18:29:31 -0700 Subject: Implemented new Real-Time friendly Memory Allocation Scheme --- src/lib/kmem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/kmem.c b/src/lib/kmem.c index fc91fc4..5fda56a 100644 --- a/src/lib/kmem.c +++ b/src/lib/kmem.c @@ -36,6 +36,8 @@ void* kcalloc(unsigned int size) void* krealloc(void* old, unsigned int size) { + if (!(kmem_begin <= old && old < kmem_begin + 0x200000)) + return 0; unsigned long old_size = 1; while (!((unsigned long)kmem_begin + 0x1000*(old_size/2) <= (unsigned long)old && (unsigned long)old < (unsigned long)kmem_begin + 0x1000*old_size)) old_size *= 2; -- cgit v1.2.1