mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-12 05:14:10 +02:00
Adding StdAllocator
This commit is contained in:
parent
116a519f4e
commit
1a64a87cc6
1 changed files with 21 additions and 0 deletions
21
BeefLibs/corlib/src/Allocator.bf
Normal file
21
BeefLibs/corlib/src/Allocator.bf
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue