kernel: Move aligned_alloc to heap.cpp alongside calloc.

It is independent of whatever heap implementation is actually in use,
so it belongs in here (even if this file is probably not the right
place for such functions in the first place.)

This allows the kernel to be built once again with things other than
the default slab heap.
This commit is contained in:
Augustin Cavalier 2022-06-21 22:59:57 -04:00
parent 8e059bfa63
commit 4b6af34c06
2 changed files with 10 additions and 10 deletions

View File

@ -2493,6 +2493,16 @@ calloc(size_t numElements, size_t size)
}
void *
aligned_alloc(size_t alignment, size_t size)
{
if ((size % alignment) != 0)
return NULL;
return memalign(alignment, size);
}
void
deferred_free(void *block)
{

View File

@ -229,16 +229,6 @@ posix_memalign(void** _pointer, size_t alignment, size_t size)
}
void *
aligned_alloc(size_t alignment, size_t size)
{
if ((size % alignment) != 0)
return NULL;
return memalign(alignment, size);
}
void
free_etc(void *address, uint32 flags)
{