Comments, adding Region to Heap
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
This commit is contained in:
@@ -33,14 +33,18 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "region.h"
|
||||
|
||||
namespace mimir {
|
||||
|
||||
// Heap implementation based on Two-Level Segregated Fit (TLSF) memory allocation
|
||||
class Heap
|
||||
{
|
||||
public:
|
||||
Heap();
|
||||
~Heap();
|
||||
|
||||
bool init(size_t minSize = 1ULL << 24, size_t maxSize = 1ULL << 32);
|
||||
bool init(size_t maxSize = 1ULL << 32);
|
||||
|
||||
// Allocate `size` bytes
|
||||
std::byte* alloc(size_t size);
|
||||
@@ -50,6 +54,9 @@ public:
|
||||
|
||||
// Allocate `size` bytes, aligned to 64 bytes and padded to next 64-byte offset.
|
||||
std::byte* allocA64(size_t size);
|
||||
|
||||
private:
|
||||
Region m_region;
|
||||
};
|
||||
|
||||
} // namespace mimir
|
||||
|
||||
Reference in New Issue
Block a user