diff options
author | Keith Winstein <208955+keithw@users.noreply.github.com> | 2024-11-08 07:45:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-08 07:45:07 -0800 |
commit | 765b47d02aac894da80b74284263d1b487415aa0 (patch) | |
tree | 9e7275ddf2f8f3326c3a779e30a3aa963159ffa7 /include/wabt/interp/interp-inl.h | |
parent | c1d97e9c75c687faa81fe0ab4f1ac77c30487f47 (diff) | |
download | wabt-765b47d02aac894da80b74284263d1b487415aa0.tar.gz wabt-765b47d02aac894da80b74284263d1b487415aa0.tar.bz2 wabt-765b47d02aac894da80b74284263d1b487415aa0.zip |
Add support for the custom-page-sizes proposal (#2502)
This adds support in the binary/text parsers and writers,
the validator and interpreter, and objdump (but not wasm2c).
Diffstat (limited to 'include/wabt/interp/interp-inl.h')
-rw-r--r-- | include/wabt/interp/interp-inl.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/wabt/interp/interp-inl.h b/include/wabt/interp/interp-inl.h index 1f3402c6..a9ac4a34 100644 --- a/include/wabt/interp/interp-inl.h +++ b/include/wabt/interp/interp-inl.h @@ -64,11 +64,12 @@ inline bool MemoryType::classof(const ExternType* type) { return type->kind == skind; } -inline MemoryType::MemoryType(Limits limits) - : ExternType(ExternKind::Memory), limits(limits) { +inline MemoryType::MemoryType(Limits limits, uint32_t page_size) + : ExternType(ExternKind::Memory), limits(limits), page_size(page_size) { // Always set max. if (!limits.has_max) { - this->limits.max = limits.is_64 ? WABT_MAX_PAGES64 : WABT_MAX_PAGES32; + this->limits.max = WABT_BYTES_TO_MIN_PAGES( + (limits.is_64 ? UINT64_MAX : UINT32_MAX), page_size); } } |