File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 22#define __wasilibc___macro_PAGESIZE_h
33
44/*
5- * The page size in WebAssembly is fixed at 64 KiB. If this ever changes,
6- * it's expected that applications will need to opt in, so we can change
7- * this.
5+ * Without custom-page-sizes proposal, the page size in WebAssembly
6+ * is fixed at 64 KiB.
7+ *
8+ * The LLVM versions with a support of custom-page-sizes proposal
9+ * provides __wasm_first_page_end global to allow page-size-agnostic
10+ * objects.
811 *
912 * If this ever needs to be a value outside the range of an `int`, the
1013 * `getpagesize` function which returns this value will need special
1114 * consideration. POSIX has deprecated `getpagesize` in favor of
1215 * `sysconf(_SC_PAGESIZE)` which does not have this problem.
1316 */
17+ #if __clang_major__ >= 22
18+ extern char __wasm_first_page_end ;
19+ #define PAGESIZE ((unsigned long)&__wasm_first_page_end)
20+ #else
1421#define PAGESIZE (0x10000)
22+ #endif
1523
1624#endif
You can’t perform that action at this time.
0 commit comments