mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-23 08:35:47 +00:00
Revert "THIS NEEDS TO BE CHECKED BEFORE MERGE: RAII fix, initial MSAA, some fixes for memory misallocation (#116)"
This reverts commit ce5d5d2aff
.
This commit is contained in:
parent
89c06a7383
commit
3cad73dad6
6 changed files with 121 additions and 315 deletions
|
@ -12,22 +12,12 @@ class FreeRegionManager {
|
|||
public:
|
||||
explicit FreeRegionManager() = default;
|
||||
~FreeRegionManager() = default;
|
||||
|
||||
// Clear all free regions
|
||||
void Clear() {
|
||||
std::scoped_lock lk(m_mutex);
|
||||
m_free_regions.clear();
|
||||
}
|
||||
|
||||
void SetAddressSpace(void* start, size_t size) {
|
||||
this->FreeBlock(start, size);
|
||||
}
|
||||
|
||||
std::pair<void*, size_t> FreeBlock(void* block_ptr, size_t size) {
|
||||
if (block_ptr == nullptr || size == 0) {
|
||||
return {nullptr, 0};
|
||||
}
|
||||
|
||||
std::scoped_lock lk(m_mutex);
|
||||
|
||||
// Check to see if we are adjacent to any regions.
|
||||
|
@ -51,11 +41,6 @@ public:
|
|||
}
|
||||
|
||||
void AllocateBlock(void* block_ptr, size_t size) {
|
||||
// Skip if pointer is null or size is zero
|
||||
if (block_ptr == nullptr || size == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::scoped_lock lk(m_mutex);
|
||||
|
||||
auto address = reinterpret_cast<uintptr_t>(block_ptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue