From cd56a105e347925618c730486fe1dfec56865a08 Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 11 Feb 2022 20:33:19 +0100 Subject: [PATCH] Add memory barrier to ensure memory coherence --- source/memory_mapping.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/memory_mapping.cpp b/source/memory_mapping.cpp index 9a66f25..7028675 100644 --- a/source/memory_mapping.cpp +++ b/source/memory_mapping.cpp @@ -416,6 +416,7 @@ void *MemoryMapping_allocEx(uint32_t size, int32_t align, bool videoOnly) { break; } } + OSMemoryBarrier(); OSUnlockMutex(&allocMutex); return res; } @@ -447,6 +448,7 @@ void MemoryMapping_free(void *ptr) { break; } } + OSMemoryBarrier(); OSUnlockMutex(&allocMutex); }