alexcrichton opened PR #1290 from rewrite-func
to master
:
This commit is a continuation of #1237 and updates the API of
Func
to
allow defining host functions which have easy access to a caller's
memory in particular. The new APIs look like so:
The
Func::wrap*
family of functions was condensed into one
Func::wrap
function.The ABI layer of conversions in
WasmTy
were removed- An optional
Caller<'_>
argument can be at the front of all
host-defined functions now.The old way the wasi bindings looked up memory has been removed and is
now replaced with theCaller
type. TheCaller
type has a
get_export
method on it which allows looking up a caller's export by
name, allowing you to get access to the caller's memory easily, and even
during instantiation.
alexcrichton updated PR #1290 from rewrite-func
to master
:
This commit is a continuation of #1237 and updates the API of
Func
to
allow defining host functions which have easy access to a caller's
memory in particular. The new APIs look like so:
The
Func::wrap*
family of functions was condensed into one
Func::wrap
function.The ABI layer of conversions in
WasmTy
were removed- An optional
Caller<'_>
argument can be at the front of all
host-defined functions now.The old way the wasi bindings looked up memory has been removed and is
now replaced with theCaller
type. TheCaller
type has a
get_export
method on it which allows looking up a caller's export by
name, allowing you to get access to the caller's memory easily, and even
during instantiation.
alexcrichton requested sunfishcode for a review on PR #1290.
alexcrichton updated PR #1290 from rewrite-func
to master
:
This commit is a continuation of #1237 and updates the API of
Func
to
allow defining host functions which have easy access to a caller's
memory in particular. The new APIs look like so:
The
Func::wrap*
family of functions was condensed into one
Func::wrap
function.The ABI layer of conversions in
WasmTy
were removed- An optional
Caller<'_>
argument can be at the front of all
host-defined functions now.The old way the wasi bindings looked up memory has been removed and is
now replaced with theCaller
type. TheCaller
type has a
get_export
method on it which allows looking up a caller's export by
name, allowing you to get access to the caller's memory easily, and even
during instantiation.
sunfishcode submitted PR Review.
sunfishcode submitted PR Review.
sunfishcode created PR Review Comment:
It feels like this paragraph belongs on the
struct
rather than on theget_export
method.
sunfishcode created PR Review Comment:
It'd be good to mention somewhere that this is intended to be a temporary mechanism, and that we're hoping interface types will provide better ways to do this in the future.
alexcrichton updated PR #1290 from rewrite-func
to master
:
This commit is a continuation of #1237 and updates the API of
Func
to
allow defining host functions which have easy access to a caller's
memory in particular. The new APIs look like so:
The
Func::wrap*
family of functions was condensed into one
Func::wrap
function.The ABI layer of conversions in
WasmTy
were removed- An optional
Caller<'_>
argument can be at the front of all
host-defined functions now.The old way the wasi bindings looked up memory has been removed and is
now replaced with theCaller
type. TheCaller
type has a
get_export
method on it which allows looking up a caller's export by
name, allowing you to get access to the caller's memory easily, and even
during instantiation.
sunfishcode submitted PR Review.
alexcrichton merged PR #1290.
Last updated: Dec 23 2024 at 12:05 UTC