spacewander opened issue #3308:
Hi, I am studying the API of wasmtime.
I notice that there are some notes about Store: https://docs.wasmtime.dev/api/wasmtime/struct.Store.htmlA Store is intended to be a short-lived object in a program. No form of GC is implemented at this time so once an instance is created within a Store it will not be deallocated until the Store itself is dropped.
I am curious about what is the scope of the "GC", does it cover:
- module-level variables
- memory allocated inside wasmtime and bound to the Store
- variables used in wasm functions
And is there any documentation about the memory management inside the wasm runtime?
Thanks for your reply!
bjorn3 commented on issue #3308:
It covers things like instances, memories and tables. Instances contain references to module-level globals. Variables used in wasm functions are stored on the stack and are thus deallocated as soon the respective function returns.
spacewander commented on issue #3308:
Thanks. Are there any docs about the wasmtime's memory management mechanism?
alexcrichton commented on issue #3308:
The only form of memory management in Wasmtime itself is an implementation of reference counting for
ExternRef
with optimizations in wasm code itself do to less reference counting. Other than that all memory management in Wasmtime is like malloc/free in normal Rust, calling functions may allocation and dropping things deallocates them.
spacewander commented on issue #3308:
I see. Thanks.
spacewander closed issue #3308:
Hi, I am studying the API of wasmtime.
I notice that there are some notes about Store: https://docs.wasmtime.dev/api/wasmtime/struct.Store.htmlA Store is intended to be a short-lived object in a program. No form of GC is implemented at this time so once an instance is created within a Store it will not be deallocated until the Store itself is dropped.
I am curious about what is the scope of the "GC", does it cover:
- module-level variables
- memory allocated inside wasmtime and bound to the Store
- variables used in wasm functions
And is there any documentation about the memory management inside the wasm runtime?
Thanks for your reply!
Last updated: Dec 23 2024 at 12:05 UTC