forked from Bananymous/banan-os
BAN: remove aligned alloc from ban
This commit is contained in:
parent
52aa98ba25
commit
1c146ba1a5
|
@ -1,11 +1,7 @@
|
||||||
#include <BAN/Memory.h>
|
#include <BAN/Memory.h>
|
||||||
|
|
||||||
namespace std { enum class align_val_t : size_t {}; }
|
|
||||||
|
|
||||||
void* operator new(size_t size) { return BAN::allocator(size); }
|
void* operator new(size_t size) { return BAN::allocator(size); }
|
||||||
void* operator new[](size_t size) { return BAN::allocator(size); }
|
void* operator new[](size_t size) { return BAN::allocator(size); }
|
||||||
void* operator new(size_t size, std::align_val_t align) { return BAN::allocator_align(size, (size_t)align); }
|
|
||||||
void* operator new[](size_t size, std::align_val_t align) { return BAN::allocator_align(size, (size_t)align); }
|
|
||||||
|
|
||||||
void operator delete(void* addr) { BAN::deallocator(addr); }
|
void operator delete(void* addr) { BAN::deallocator(addr); }
|
||||||
void operator delete[](void* addr) { BAN::deallocator(addr); }
|
void operator delete[](void* addr) { BAN::deallocator(addr); }
|
||||||
|
|
|
@ -17,7 +17,6 @@ namespace BAN
|
||||||
{
|
{
|
||||||
#if defined(__is_kernel)
|
#if defined(__is_kernel)
|
||||||
static constexpr void*(&allocator)(size_t) = kmalloc;
|
static constexpr void*(&allocator)(size_t) = kmalloc;
|
||||||
static constexpr void*(&allocator_align)(size_t, size_t) = kmalloc;
|
|
||||||
static constexpr void(&deallocator)(void*) = kfree;
|
static constexpr void(&deallocator)(void*) = kfree;
|
||||||
#else
|
#else
|
||||||
static constexpr void*(&allocator)(size_t) = malloc;
|
static constexpr void*(&allocator)(size_t) = malloc;
|
||||||
|
|
Loading…
Reference in New Issue