From 7ea271bfec7f18dcc580aa98e037a0f722581d93 Mon Sep 17 00:00:00 2001 From: xerox Date: Tue, 10 Nov 2020 11:43:51 -0800 Subject: [PATCH] destructor was failing because it was using memcpy to zero a pml4e that mapped the address it was writing too, now its a move instruction (8 byte move) --- nasa-tables/mem_ctx/mem_ctx.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nasa-tables/mem_ctx/mem_ctx.cpp b/nasa-tables/mem_ctx/mem_ctx.cpp index f767947..7ca9467 100644 --- a/nasa-tables/mem_ctx/mem_ctx.cpp +++ b/nasa-tables/mem_ctx/mem_ctx.cpp @@ -76,8 +76,11 @@ namespace nasa mem_ctx::~mem_ctx() { - set_pml4e(reinterpret_cast<::ppml4e>(get_dirbase()) + this->pml4e_index, pml4e{NULL}); - while (!SwitchToThread()); + const auto pml4 = + reinterpret_cast( + set_page(dirbase)); + + pml4[pml4e_index] = pml4e{ NULL }; } void* mem_ctx::set_page(void* addr)