From 847fb951e29bb9bfb2735cf6bb1186e0374f3654 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 12 Apr 2016 23:29:25 -0400 Subject: shader_jit_x64: Free memory that's no longer needed after compilation. --- src/video_core/shader/shader_jit_x64.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp index e32a4e720..773542283 100644 --- a/src/video_core/shader/shader_jit_x64.cpp +++ b/src/video_core/shader/shader_jit_x64.cpp @@ -845,6 +845,12 @@ void JitCompiler::Compile() { SetJumpTarget(branch.first, code_ptr[branch.second]); } + // Free memory that's no longer needed + return_offsets.clear(); + return_offsets.shrink_to_fit(); + fixup_branches.clear(); + fixup_branches.shrink_to_fit(); + uintptr_t size = reinterpret_cast(GetCodePtr()) - reinterpret_cast(program); ASSERT_MSG(size <= MAX_SHADER_SIZE, "Compiled a shader that exceeds the allocated size!"); -- cgit v1.2.3