mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Initial checkin
This commit is contained in:
parent
c74712dad9
commit
078564ac9e
3242 changed files with 1616395 additions and 0 deletions
46
IDEHelper/HotHeap.h
Normal file
46
IDEHelper/HotHeap.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
#pragma once
|
||||
|
||||
#include "DebugCommon.h"
|
||||
#include "BeefySysLib/util/Dictionary.h"
|
||||
#include "BeefySysLib/util/Array.h"
|
||||
|
||||
NS_BF_DBG_BEGIN
|
||||
|
||||
class HotHeap
|
||||
{
|
||||
public:
|
||||
enum HotUseFlags
|
||||
{
|
||||
HotUseFlags_None,
|
||||
HotUseFlags_Allocated,
|
||||
HotUseFlags_Referenced
|
||||
};
|
||||
|
||||
public:
|
||||
static const int BLOCK_SIZE = 4096;
|
||||
|
||||
addr_target mHotAreaStart;
|
||||
int mHotAreaSize;
|
||||
Beefy::Array<HotUseFlags> mHotAreaUsed;
|
||||
|
||||
int mCurBlockIdx;
|
||||
int mBlockAllocIdx; // Total blocks allocated, doesn't decrease with frees
|
||||
|
||||
Beefy::Dictionary<addr_target, int> mTrackedMap;
|
||||
|
||||
public:
|
||||
HotHeap(addr_target hotStart, int size);
|
||||
HotHeap();
|
||||
|
||||
void AddTrackedRegion(addr_target hotStart, int size);
|
||||
|
||||
addr_target Alloc(int size);
|
||||
void Release(addr_target addr, int size);
|
||||
void MarkBlockReferenced(addr_target addr);
|
||||
bool IsReferenced(addr_target addr, int size);
|
||||
bool IsBlockUsed();
|
||||
void ClearReferencedFlags();
|
||||
intptr_target GetUsedSize();
|
||||
};
|
||||
|
||||
NS_BF_DBG_END
|
Loading…
Add table
Add a link
Reference in a new issue