github.com/higress-group/nottinygc@v0.0.0-20231101025119-e93c4c2f8520/buildtools/bdwgc/bdwgc.patch (about) 1 diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h 2 index 6970e6f2..a3af3824 100644 3 --- a/include/private/gcconfig.h 4 +++ b/include/private/gcconfig.h 5 @@ -2480,6 +2480,8 @@ EXTERN_C_BEGIN 6 # endif 7 # undef USE_MMAP /* similar to Emscripten */ 8 # undef USE_MUNMAP 9 + /* The real page size in WebAssembly is 64 KB. */ 10 +# define GETPAGESIZE() 65536 11 # if defined(GC_THREADS) && !defined(CPPCHECK) 12 # error No threads support yet 13 # endif 14 @@ -3008,10 +3010,10 @@ EXTERN_C_BEGIN 15 16 /* Whether GC_page_size is to be set to a value other than page size. */ 17 #if defined(CYGWIN32) && (defined(MPROTECT_VDB) || defined(USE_MUNMAP)) \ 18 - || (!defined(ANY_MSWIN) && !defined(USE_MMAP) \ 19 + || (!defined(ANY_MSWIN) && !defined(WASI) && !defined(USE_MMAP) \ 20 && (defined(GC_DISABLE_INCREMENTAL) || defined(DEFAULT_VDB))) 21 /* Cygwin: use the allocation granularity instead. */ 22 - /* Other than Windows: use HBLKSIZE instead (unless mmap() is used). */ 23 + /* Other than Windows or WASI: use HBLKSIZE instead (unless mmap() is used). */ 24 # define ALT_PAGESIZE_USED 25 # ifndef GC_NO_VALLOC 26 /* Nonetheless, we need the real page size is some extra functions. */