Stream: git-wasmtime

Topic: wasmtime / PR #2282 add new_with_user_state


view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 11:59):

zhiqiangxu opened PR #2282 from custom_user_state to main:

Allow user to specify custom user state.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 11:59):

zhiqiangxu edited PR #2282 from custom_user_state to main:

Allow user to specify custom user state when instantiate wasm instance.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:00):

zhiqiangxu edited PR #2282 from custom_user_state to main:

Allow user to specify custom user state when instantiate a wasm instance.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:04):

bjorn3 submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:04):

bjorn3 submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:04):

bjorn3 created PR Review Comment:

    pub fn new(store: &Store, module: &Module, imports: &[Extern]) -> Result<Instance, Error> {
        Instance::new_with_user_state(store, module, imports, None)
    }

This function is also missing documentation.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:04):

bjorn3 created PR Review Comment:

    pub fn new_with_user_state(

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:08):

zhiqiangxu updated PR #2282 from custom_user_state to main:

Allow user to specify custom user state when instantiate a wasm instance.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:10):

zhiqiangxu submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:10):

zhiqiangxu created PR Review Comment:

Fixed, _new is removed.

One can access the user state by instance.host_state() then cast it to HostState

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:11):

bjorn3 submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:11):

bjorn3 created PR Review Comment:

        Instance::new_with_user_state(store, module, imports, None)
  1. You can't use new_with_user_state directly as it isn't imported in the current module.
  2. Please prefer implicit return at the end of a block/function.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:12):

zhiqiangxu updated PR #2282 from custom_user_state to main:

Allow user to specify custom user state when instantiate a wasm instance.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:18):

zhiqiangxu updated PR #2282 from custom_user_state to main:

Allow user to specify custom user state when instantiate a wasm instance.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:18):

zhiqiangxu submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:18):

zhiqiangxu created PR Review Comment:

Fixed.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:26):

zhiqiangxu updated PR #2282 from custom_user_state to main:

Allow user to specify custom user state when instantiate a wasm instance.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:28):

zhiqiangxu updated PR #2282 from custom_user_state to main:

Allow user to specify custom user state when instantiate a wasm instance.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:30):

bjorn3 created PR Review Comment:

This shouldn't be necessary.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:30):

bjorn3 submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:34):

zhiqiangxu submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:34):

zhiqiangxu created PR Review Comment:

Otherwise it will report: warning: field is never read: frame_info_registration.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:41):

bjorn3 submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:41):

bjorn3 created PR Review Comment:

    _frame_info_registration: Option<Arc<GlobalFrameInfoRegistration>>,

This supressed the dead code warning for this field only.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:41):

bjorn3 edited PR Review Comment.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:44):

zhiqiangxu submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 12:44):

zhiqiangxu created PR Review Comment:

I moved #[allow(dead_code)] to above the frame_info_registration field

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2020 at 13:55):

zhiqiangxu updated PR #2282 from custom_user_state to main:

Allow user to specify custom user state when instantiate a wasm instance.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 24 2021 at 18:39):

alexcrichton closed without merge PR #2282.


Last updated: Nov 22 2024 at 16:03 UTC