Add a simplistic memalign() to the runtime_loader heap.

As KMessage now makes use of memalign() the simple heap in the
runtime_loader needs to provide that as well. Fixes build.
This commit is contained in:
Michael Lotz
2011-12-10 19:07:33 +01:00
parent 9a87646122
commit 82929f8a76
+10
View File
@@ -9,6 +9,7 @@
#include <syscalls.h> #include <syscalls.h>
#include <util/kernel_cpp.h> #include <util/kernel_cpp.h>
#include <malloc.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -318,6 +319,15 @@ restart:
} }
void *
memalign(size_t alignment, size_t size)
{
// pseudo alignment by just upping the size
size = (size + alignment - 1) & ~alignment;
return malloc(size);
}
void void
free(void *allocated) free(void *allocated)
{ {