From 16cff62d36201651bfc998a623516f6cda721fa0 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Sun, 14 May 2017 00:59:52 -0500 Subject: [PATCH] Base: Remove memory::DeallocationType::kDecommitRelease (an invalid combination) --- src/xenia/base/memory.h | 1 - src/xenia/base/memory_win.cc | 4 +--- src/xenia/cpu/backend/x64/x64_emitter.cc | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/xenia/base/memory.h b/src/xenia/base/memory.h index 94c998c92..409d3a0a6 100644 --- a/src/xenia/base/memory.h +++ b/src/xenia/base/memory.h @@ -45,7 +45,6 @@ enum class AllocationType { enum class DeallocationType { kRelease = 1 << 0, kDecommit = 1 << 1, - kDecommitRelease = kRelease | kDecommit, }; // Allocates a block of memory at the given page-aligned base address. diff --git a/src/xenia/base/memory_win.cc b/src/xenia/base/memory_win.cc index 46ede2500..0113c5f6d 100644 --- a/src/xenia/base/memory_win.cc +++ b/src/xenia/base/memory_win.cc @@ -97,13 +97,11 @@ bool DeallocFixed(void* base_address, size_t length, switch (deallocation_type) { case DeallocationType::kRelease: free_type = MEM_RELEASE; + length = 0; break; case DeallocationType::kDecommit: free_type = MEM_DECOMMIT; break; - case DeallocationType::kDecommitRelease: - free_type = MEM_RELEASE | MEM_DECOMMIT; - break; default: assert_unhandled_case(deallocation_type); break; diff --git a/src/xenia/cpu/backend/x64/x64_emitter.cc b/src/xenia/cpu/backend/x64/x64_emitter.cc index 0e3cbe31c..38c811b47 100644 --- a/src/xenia/cpu/backend/x64/x64_emitter.cc +++ b/src/xenia/cpu/backend/x64/x64_emitter.cc @@ -684,7 +684,7 @@ static const uintptr_t kConstDataLocation = 0x20000000; static const uintptr_t kConstDataSize = sizeof(xmm_consts); // Increment the location by this amount for every allocation failure. -static const uintptr_t kConstDataIncrement = 0x00010000; +static const uintptr_t kConstDataIncrement = 0x00001000; // This function places constant data that is used by the emitter later on. // Only called once and used by multiple instances of the emitter. @@ -713,7 +713,7 @@ uintptr_t X64Emitter::PlaceConstData() { void X64Emitter::FreeConstData(uintptr_t data) { memory::DeallocFixed(reinterpret_cast(data), 0, - memory::DeallocationType::kDecommitRelease); + memory::DeallocationType::kRelease); } Xbyak::Address X64Emitter::GetXmmConstPtr(XmmConst id) {