2 let page_size = page_size::get();
4 // In particular, this checks that it is not 0.
5 assert!(page_size.is_power_of_two(), "page size not a power of two: {}", page_size);
6 // Most architectures have 4k pages by default
8 target_arch = "wasm32",
9 target_arch = "wasm64",
10 all(target_arch = "aarch64", target_vendor = "apple")
12 assert!(page_size == 4 * 1024, "non-4k default page size: {}", page_size);
13 // ... except aarch64-apple with 16k
14 #[cfg(all(target_arch = "aarch64", target_vendor = "apple"))]
15 assert!(page_size == 16 * 1024, "aarch64 apple reports non-16k page size: {}", page_size);
16 // ... and wasm with 64k
17 #[cfg(any(target_arch = "wasm32", target_arch = "wasm64"))]
18 assert!(page_size == 64 * 1024, "wasm reports non-64k page size: {}", page_size);