2021-06-27 21:25:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: Heap.hpp
|
|
|
|
Date: 2021-6-12
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
2022-03-21 05:20:19 +00:00
|
|
|
namespace Aurora::Memory
|
|
|
|
{
|
2022-12-07 01:29:09 +00:00
|
|
|
struct BaseHeap : Heap
|
|
|
|
{
|
|
|
|
void *base_ {};
|
|
|
|
AuUInt length_ {};
|
2022-12-08 19:34:15 +00:00
|
|
|
HeapStats stats;
|
|
|
|
|
|
|
|
virtual void UpdateStats() = 0;
|
|
|
|
|
|
|
|
inline HeapStats &GetStats() override
|
|
|
|
{
|
|
|
|
UpdateStats();
|
|
|
|
return stats;
|
|
|
|
}
|
2022-12-07 01:29:09 +00:00
|
|
|
};
|
|
|
|
|
2022-07-21 09:59:02 +00:00
|
|
|
AuSPtr<Heap> AllocateDivisionGlobal(Heap *heap, AuUInt32 length, AuUInt32 alignment);
|
2022-03-21 05:20:19 +00:00
|
|
|
}
|