diff options
| author | Mai <mai.iam2048@gmail.com> | 2023-03-27 10:31:53 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-27 10:31:53 -0400 |
| commit | c096ee64f2abdef2b095ce8092dcde4146d44fc0 (patch) | |
| tree | d9c15844712ea6aad1715cf74bdbfde1001caa90 /Source/UnitTests/Core | |
| parent | 0de2890351ef2e309abd7643a38b8505ba42de19 (diff) | |
| parent | 7f50c070b232b68df04609f60f02db559e97cc4f (diff) | |
Merge pull request #11696 from AdmiralCurtiss/jit-interface-class
JitInterface: Refactor to class, move to System.
Diffstat (limited to 'Source/UnitTests/Core')
| -rw-r--r-- | Source/UnitTests/Core/PageFaultTest.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/UnitTests/Core/PageFaultTest.cpp b/Source/UnitTests/Core/PageFaultTest.cpp index be8de724c1..ab0cdd7bcc 100644 --- a/Source/UnitTests/Core/PageFaultTest.cpp +++ b/Source/UnitTests/Core/PageFaultTest.cpp @@ -75,8 +75,10 @@ TEST(PageFault, PageFault) EXPECT_NE(data, nullptr); Common::WriteProtectMemory(data, PAGE_GRAN, false); - PageFaultFakeJit pfjit(Core::System::GetInstance()); - JitInterface::SetJit(&pfjit); + auto& system = Core::System::GetInstance(); + auto unique_pfjit = std::make_unique<PageFaultFakeJit>(system); + auto& pfjit = *unique_pfjit; + system.GetJitInterface().SetJit(std::move(unique_pfjit)); pfjit.m_data = data; auto start = std::chrono::high_resolution_clock::now(); @@ -88,7 +90,6 @@ TEST(PageFault, PageFault) }; EMM::UninstallExceptionHandler(); - JitInterface::SetJit(nullptr); fmt::print("page fault timing:\n"); fmt::print("start->HandleFault {} ns\n", @@ -98,4 +99,6 @@ TEST(PageFault, PageFault) fmt::print("HandleFault->end {} ns\n", difference_in_nanoseconds(pfjit.m_post_unprotect_time, end)); fmt::print("total {} ns\n", difference_in_nanoseconds(start, end)); + + system.GetJitInterface().SetJit(nullptr); } |
