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:
swurl 2025-05-19 15:22:08 -04:00
parent 89c06a7383
commit 3cad73dad6
No known key found for this signature in database
GPG key ID: A5A7629F109C8FD1
6 changed files with 121 additions and 315 deletions

View file

@ -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);