From 5bbb2ff416ec4d374d49f742dff610028ecd72e4 Mon Sep 17 00:00:00 2001 From: daan Date: Thu, 16 Dec 2021 15:34:52 -0800 Subject: [PATCH] reenable the use of sbrk on wasm as it seems more stable than direct memory_grow --- src/os.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/os.c b/src/os.c index 71b371d2..a799cdf1 100644 --- a/src/os.c +++ b/src/os.c @@ -8,6 +8,8 @@ terms of the MIT license. A copy of the license can be found in the file #define _DEFAULT_SOURCE // ensure mmap flags are defined #endif +#define MI_USE_SBRK + #if defined(__sun) // illumos provides new mman.h api when any of these are defined // otherwise the old api based on caddr_t which predates the void pointers one. @@ -26,6 +28,10 @@ terms of the MIT license. A copy of the license can be found in the file #pragma warning(disable:4996) // strerror #endif +#if defined(__wasi__) +#define MI_USE_SBRK +#endif + #if defined(_WIN32) #include #elif defined(__wasi__)