Skip to content

Commit

Permalink
use our own cabi_realloc
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsavara committed Jul 2, 2024
1 parent 7d957b6 commit ca33591
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/mono/wasi/runtime/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,3 +413,11 @@ mono_wasm_string_array_new (int size)
{
return mono_array_new (root_domain, mono_get_string_class (), size);
}

void *cabi_realloc(void *ptr, size_t old_size, size_t align, size_t new_size);

void
mono_wasm_dummy_keep_alive (int size)
{
cabi_realloc(0, 0, 0, 0);
}
2 changes: 1 addition & 1 deletion src/mono/wasi/wasi.proj
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<_WasiCompileFlags Include="-D_WASI_EMULATED_MMAN"/>
<!-- keep in sync with src\mono\wasi\build\WasiApp.Native.targets -->
<!-- keep stack-size in sync with wasm_get_stack_size until after https://github.com/llvm/llvm-project/commit/1532be98f99384990544bd5289ba339bca61e15b in WASI SDK -->
<_WasiLinkFlags Include="-Wl,-z,stack-size=8388608,--initial-memory=52428800,-lwasi-emulated-process-clocks,-lwasi-emulated-signal,-lwasi-emulated-mman,--undefined=cabi_realloc"/>
<_WasiLinkFlags Include="-Wl,-z,stack-size=8388608,--initial-memory=52428800,-lwasi-emulated-process-clocks,-lwasi-emulated-signal,-lwasi-emulated-mman"/>
</ItemGroup>

<PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/native/libs/System.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ else()
pal_signal_wasi.c
pal_threading_wasi.c
pal_uid_wasi.c
pal_cabi_wasi.h
pal_cabi_wasi.c
)
endif()
Expand Down

0 comments on commit ca33591

Please sign in to comment.