metaforce/Runtime/CGameAllocator.hpp

36 lines
762 B
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
#include <cstddef>
#include <memory>
#include <vector>
#include "Runtime/RetroTypes.hpp"
2021-04-10 08:42:06 +00:00
namespace metaforce {
2020-09-08 17:58:55 +00:00
class CCallStack {
const char* x0_line;
const char* x4_type;
public:
CCallStack(int lineNum, const char* lineStr, const char* type) : x0_line(lineStr), x4_type(type) {}
};
2020-09-08 17:58:55 +00:00
class CGameAllocator {
struct SGameMemInfo {
u32 x0_sentinel = 0xefefefef;
size_t x4_len = 0;
const char* x8_line;
const char* xc_type;
SGameMemInfo* x10_prev = nullptr;
void* x14_ = nullptr;
void* x18_ = nullptr;
u32 x1c_canary = 0xeaeaeaea;
2018-12-08 05:30:43 +00:00
};
2020-09-08 17:58:55 +00:00
static u32 GetFreeBinEntryForSize(size_t len);
std::array<SGameMemInfo, 16> x14_bins;
public:
2020-09-08 17:58:55 +00:00
bool Initialize();//const COsContext& ctx);
};
2021-04-10 08:42:06 +00:00
} // namespace metaforce
2020-09-08 17:58:55 +00:00