AuroraRuntime/Source/Memory/DefaultHeap.cpp

80 lines
2.1 KiB
C++
Raw Normal View History

2021-06-27 21:25:29 +00:00
/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: DefaultHeap.cpp
Date: 2021-6-13
Author: Reece
***/
2021-09-30 14:57:41 +00:00
#include <Source/RuntimeInternal.hpp>
2021-06-27 21:25:29 +00:00
#include "Memory.hpp"
#include "DefaultHeap.hpp"
namespace Aurora::Memory
{
class DefaultHeap : public Heap
{
void *_ZAlloc(Types::size_t length) override
{
return Aurora::Memory::_ZAlloc(length);
}
void *_ZAlloc(Types::size_t length, Types::size_t align) override
{
return Aurora::Memory::_ZAlloc(length, align);
}
Types::size_t GetChunkSize(const void *head) override
{
return Aurora::Memory::GetChunkSize(head);
}
void *_FAlloc(Types::size_t length) override
{
return Aurora::Memory::_FAlloc(length);
}
void *_FAlloc(Types::size_t length, Types::size_t align) override
{
return Aurora::Memory::_FAlloc(length, align);
}
void *_ZRealloc(void *buffer, Types::size_t length, Types::size_t align) override
{
return Aurora::Memory::_ZRealloc(buffer, length, align);
}
void *_ZRealloc(void *buffer, Types::size_t length) override
{
return Aurora::Memory::_ZRealloc(buffer, length);
}
void *_FRealloc(void *buffer, Types::size_t length, Types::size_t align) override
{
return Aurora::Memory::_FRealloc(buffer, length, align);
}
void *_FRealloc(void *buffer, Types::size_t length) override
{
return Aurora::Memory::_FRealloc(buffer, length);
}
void _Free(void *buffer) override
{
return Aurora::Memory::_Free(buffer);
}
AuSPtr<Heap> GetSelfReference() override
{
return {};
}
2021-06-27 21:25:29 +00:00
};
static DefaultHeap gDefaultAllocation;
AUKN_SYM Heap *GetDefaultDiscontiguousHeapNew()
{
return &gDefaultAllocation;
}
AUKN_SYM void GetDefaultDiscontiguousHeapRelease(Heap * heap) {}
}