diff options
| author | 2016-04-12 23:29:25 -0400 | |
|---|---|---|
| committer | 2016-04-13 23:04:52 -0400 | |
| commit | 847fb951e29bb9bfb2735cf6bb1186e0374f3654 (patch) | |
| tree | c39b3db1af2bc11d39478b6a54a37d578648b3e0 /src | |
| parent | shader_jit_x64: Use a sorted vector instead of a set for keeping track of ret... (diff) | |
| download | yuzu-847fb951e29bb9bfb2735cf6bb1186e0374f3654.tar.gz yuzu-847fb951e29bb9bfb2735cf6bb1186e0374f3654.tar.xz yuzu-847fb951e29bb9bfb2735cf6bb1186e0374f3654.zip | |
shader_jit_x64: Free memory that's no longer needed after compilation.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/shader_jit_x64.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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() { | |||
| 845 | SetJumpTarget(branch.first, code_ptr[branch.second]); | 845 | SetJumpTarget(branch.first, code_ptr[branch.second]); |
| 846 | } | 846 | } |
| 847 | 847 | ||
| 848 | // Free memory that's no longer needed | ||
| 849 | return_offsets.clear(); | ||
| 850 | return_offsets.shrink_to_fit(); | ||
| 851 | fixup_branches.clear(); | ||
| 852 | fixup_branches.shrink_to_fit(); | ||
| 853 | |||
| 848 | uintptr_t size = reinterpret_cast<uintptr_t>(GetCodePtr()) - reinterpret_cast<uintptr_t>(program); | 854 | uintptr_t size = reinterpret_cast<uintptr_t>(GetCodePtr()) - reinterpret_cast<uintptr_t>(program); |
| 849 | ASSERT_MSG(size <= MAX_SHADER_SIZE, "Compiled a shader that exceeds the allocated size!"); | 855 | ASSERT_MSG(size <= MAX_SHADER_SIZE, "Compiled a shader that exceeds the allocated size!"); |
| 850 | 856 | ||