mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix: add free-list to WardenEmulator heap allocator to prevent exhaustion
The bump-pointer allocator never reused freed blocks, causing the 16 MB emulated heap to exhaust in long sessions even when blocks were freed. - First-fit reuse from a free-list before advancing the bump pointer - Coalesce adjacent free blocks to limit fragmentation - Roll back the bump pointer when the top free block reaches it - Reset allocator state on initialize() so re-runs start clean
This commit is contained in:
parent
ae40d393c3
commit
5031351736
2 changed files with 65 additions and 3 deletions
|
|
@ -152,6 +152,7 @@ private:
|
|||
|
||||
// Memory allocation tracking
|
||||
std::map<uint32_t, size_t> allocations_;
|
||||
std::map<uint32_t, size_t> freeBlocks_; // free-list keyed by base address
|
||||
uint32_t nextHeapAddr_;
|
||||
|
||||
// Hook handles for cleanup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue