Stream: wasmtime

Topic: cloning whole instance?


view this post on Zulip Benjamin Bouvier (Aug 13 2021 at 15:21):

lazy request: I understand it that the clone impl on Instance is cloning only the reference, so the same instance with the same backing memory/globals etc. Is there a way to deep-clone a full Instance (including all the wasm objects, but the module context too assuming it's Clone too)?

view this post on Zulip Alex Crichton (Aug 13 2021 at 18:20):

currently, no, I think the roughest equivalent is re-instantiating the module

view this post on Zulip fitzgen (he/him) (Aug 17 2021 at 18:44):

if you want the instance's memory and globals etc to be in the same state then you'll have to replay all the same calls after instantiation though

... or you could see if Wizer fits your use case :-p


Last updated: Dec 23 2024 at 13:07 UTC