2023-04-10 21:03:41 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#if defined(__is_kernel)
|
2023-04-14 13:30:21 +03:00
|
|
|
#include <kernel/Memory/kmalloc.h>
|
2023-04-10 21:03:41 +03:00
|
|
|
#else
|
|
|
|
#include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace BAN
|
|
|
|
{
|
|
|
|
#if defined(__is_kernel)
|
|
|
|
static constexpr void*(&allocator)(size_t) = kmalloc;
|
|
|
|
static constexpr void(&deallocator)(void*) = kfree;
|
|
|
|
#else
|
|
|
|
static constexpr void*(&allocator)(size_t) = malloc;
|
|
|
|
static constexpr void(&deallocator)(void*) = free;
|
|
|
|
#endif
|
|
|
|
}
|