aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/memory/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/memory/alloc.c')
-rw-r--r--src/kernel/memory/alloc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kernel/memory/alloc.c b/src/kernel/memory/alloc.c
index a4fb60a..904be3a 100644
--- a/src/kernel/memory/alloc.c
+++ b/src/kernel/memory/alloc.c
@@ -361,6 +361,14 @@ void *malloc(u32 req_size)
return NULL;
}
+// Definitely improveable
+void *valloc(u32 req_size)
+{
+ u32 mask = l_page_size - 1;
+ u32 mem = malloc(req_size + l_page_size);
+ return (void *)((mem + mask) & ~mask);
+}
+
void free(void *ptr)
{
struct liballoc_minor *min;