diff --git a/CMakeLists.txt b/CMakeLists.txt index dfe7b12e..c770d906 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ option(MOMO_ENABLE_AVX2 "Enable AVX2 support" ON) option(MOMO_ENABLE_SANITIZER "Enable sanitizer" OFF) option(MOMO_ENABLE_CLANG_TIDY "Enable clang-tidy checks" OFF) option(MOMO_ENABLE_RUST_CODE "Enable code parts written in rust" ON) +option(MOMO_EMSCRIPTEN_MEMORY64 "Enable memory 64 support for emscripten builds" OFF) option(MOMO_EMSCRIPTEN_SUPPORT_NODEJS "Enable Node.js filesystem for emscripten compilation" OFF) option(MOMO_BUILD_AS_LIBRARY "Configure and Build the emulator as a shared library (without the samples and tests)" OFF) diff --git a/cmake/compiler-env.cmake b/cmake/compiler-env.cmake index cb7da226..8cd65263 100644 --- a/cmake/compiler-env.cmake +++ b/cmake/compiler-env.cmake @@ -123,12 +123,26 @@ if(CMAKE_SYSTEM_NAME MATCHES "Emscripten") $<$:-sASSERTIONS> -sWASM_BIGINT -sUSE_OFFSET_CONVERTER - -sMAXIMUM_MEMORY=4gb #-sEXCEPTION_CATCHING_ALLOWED=[..] -sEXIT_RUNTIME -sASYNCIFY ) + if(MOMO_EMSCRIPTEN_MEMORY64) + momo_add_c_and_cxx_compile_options( + -sMEMORY64 + ) + + add_link_options( + -sMAXIMUM_MEMORY=8gb + -sMEMORY64 + ) + else() + add_link_options( + -sMAXIMUM_MEMORY=4gb + ) + endif() + if(MOMO_EMSCRIPTEN_SUPPORT_NODEJS) add_link_options( -lnodefs.js -sNODERAWFS=1 diff --git a/deps/unicorn b/deps/unicorn index e9492203..1cdd062a 160000 --- a/deps/unicorn +++ b/deps/unicorn @@ -1 +1 @@ -Subproject commit e9492203a1c6c7661534cce6cb883a808e611d9e +Subproject commit 1cdd062a453c22c7bbd8dc9000efc29d4f3e4a38 diff --git a/src/debugger/message_transmitter.cpp b/src/debugger/message_transmitter.cpp index 2e358fbf..a602d649 100644 --- a/src/debugger/message_transmitter.cpp +++ b/src/debugger/message_transmitter.cpp @@ -33,7 +33,7 @@ namespace debugger var message = getMessageFromQueue(); if (!message || message.length == 0) { - return null; + return 0; } const length = lengthBytesUTF8(message) + 1;