From 1a64a87cc6ea203c2aa1e9418d0cd242aaac3dde Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 16 Jun 2020 10:33:52 -0700 Subject: [PATCH] Adding StdAllocator --- BeefLibs/corlib/src/Allocator.bf | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 BeefLibs/corlib/src/Allocator.bf diff --git a/BeefLibs/corlib/src/Allocator.bf b/BeefLibs/corlib/src/Allocator.bf new file mode 100644 index 00000000..4c04db78 --- /dev/null +++ b/BeefLibs/corlib/src/Allocator.bf @@ -0,0 +1,21 @@ +namespace System +{ + interface IRawAllocator + { + void* Alloc(int size, int align); + void Free(void* ptr); + } + + struct StdAllocator : IRawAllocator + { + public void* Alloc(int size, int align) + { + return Internal.StdMalloc(size); + } + + public void Free(void* ptr) + { + Internal.StdFree(ptr); + } + } +}