-
Notifications
You must be signed in to change notification settings - Fork 715
Add support for memory growth #3569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1842,6 +1842,10 @@ WASM_RUNTIME_API_EXTERN bool | |||||||||||||||||||||||||||||||
wasm_runtime_is_import_global_linked(const char *module_name, | ||||||||||||||||||||||||||||||||
const char *global_name); | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
WASM_RUNTIME_API_EXTERN bool | ||||||||||||||||||||||||||||||||
wasm_runtime_enlarge_memory(wasm_module_inst_t module_inst, | ||||||||||||||||||||||||||||||||
uint32_t inc_page_count); | ||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i guess it's better to use uint64_t for memory64. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the current design of memory64, the max page count is UINT32_MAX since the max size of linear memory size is 274TB roughly and should be able to meet most of the requirements: wasm-micro-runtime/core/iwasm/interpreter/wasm.h Lines 97 to 108 in 65bf04e
And the type of page count in WASMMemoryInstance is kept uint32: wasm-micro-runtime/core/iwasm/interpreter/wasm_runtime.h Lines 116 to 118 in 65bf04e
So here using uint32 should be also OK. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whatever limitations the current implementation has, it's better to make the user-facing api align with the spec and future-proof, IMO. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, @bnason-nf, could you upload another PR to change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Submitted #3573. As mentioned by @wenyongh, there are other existing 32 bit memory limitations. Aside from the many |
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
typedef enum { | ||||||||||||||||||||||||||||||||
INTERNAL_ERROR, | ||||||||||||||||||||||||||||||||
MAX_SIZE_REACHED, | ||||||||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.