From 058f265bd6f8e1fedd8adb45abd4dd9f60153155 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 30 Mar 2020 00:56:57 -0700 Subject: [PATCH] lmem: fix memory block header placement error --- .../libstratosphere/source/lmem/impl/lmem_impl_exp_heap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libstratosphere/source/lmem/impl/lmem_impl_exp_heap.cpp b/libraries/libstratosphere/source/lmem/impl/lmem_impl_exp_heap.cpp index 3b168682f..021a4344f 100644 --- a/libraries/libstratosphere/source/lmem/impl/lmem_impl_exp_heap.cpp +++ b/libraries/libstratosphere/source/lmem/impl/lmem_impl_exp_heap.cpp @@ -284,7 +284,7 @@ namespace ams::lmem::impl { { /* Create the used block */ - MemoryRegion used_region{ .start = free_region_front.end, .end = free_region_back.start }; + MemoryRegion used_region{ .start = reinterpret_cast(reinterpret_cast(block) - sizeof(ExpHeapMemoryBlockHead)), .end = free_region_back.start }; ExpHeapMemoryBlockHead *used_block = InitializeUsedMemoryBlock(used_region);