From 818b190bb5cb83e98d439bf69a92f74a8f960d37 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Tue, 24 Feb 2026 15:14:46 +0100 Subject: [PATCH] Make heap init work on 64-bit Larger pointer sizes means the normal heap limits don't work. Expand them even when on 32-bit because we're already allocating 256 MB of MEM1 anyways --- src/m_Do/m_Do_machine.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/m_Do/m_Do_machine.cpp b/src/m_Do/m_Do_machine.cpp index 08ede9161a..0dcee93d4a 100644 --- a/src/m_Do/m_Do_machine.cpp +++ b/src/m_Do/m_Do_machine.cpp @@ -831,6 +831,19 @@ int mDoMch_Create() { arenaSize -= 0x6C00; arenaSize -= 0xC800; #endif + +#if TARGET_PC + // Change heap sizes to account for 64bit pointers & extra memory available. + arenaSize = 32 * 1024 * 1024; + commandHeapSize *= 2; +#if DEBUG + dynamicLinkHeapSize *= 2; +#endif + archiveHeapSize *= 2; + j2dHeapSize *= 2; + gameHeapSize *= 2; +#endif + JFWSystem::setSysHeapSize(arenaSize); my_PrintHeap("システムヒープ", arenaSize);