BAN: Move RefPtr to its own file and create New.h

New.h contains definitions for placement new operators and
BAN::allocator and BAN::dealloctor
This commit is contained in:
2023-04-10 21:03:41 +03:00
parent c660df14ec
commit 2fabe1949c
14 changed files with 36 additions and 35 deletions

18
BAN/include/BAN/New.h Normal file
View File

@@ -0,0 +1,18 @@
#pragma once
#if defined(__is_kernel)
#include <kernel/kmalloc.h>
#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
}