Stream: git-wasmtime

Topic: wasmtime / PR #1389 change Module::define_function to tak...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2020 at 13:59):

froydnj opened PR #1389 from define-function-trap-sink to master:

Experience with the define_function API has shown that returning borrowed slices of TrapSite is not ideal: the returned slice represents a borrow on the entire Module, which makes calling back into methods taking &mut self a bit tricky.

To eliminate the problem, let's require the callers of define_function to provide TrapSink instances. This style of API enables them to control when and how traps are collected, and makes the object and faerie backends simpler/more efficient by not having to worry about trap collection.

This has been discussed in #1184 and #1214. I opted not to go this route because I thought the &[TrapSite] version was easier. Experience has shown that was a mistake.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2020 at 13:59):

froydnj requested pchickey for a review on PR #1389.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2020 at 15:10):

froydnj updated PR #1389 from define-function-trap-sink to master:

Experience with the define_function API has shown that returning borrowed slices of TrapSite is not ideal: the returned slice represents a borrow on the entire Module, which makes calling back into methods taking &mut self a bit tricky.

To eliminate the problem, let's require the callers of define_function to provide TrapSink instances. This style of API enables them to control when and how traps are collected, and makes the object and faerie backends simpler/more efficient by not having to worry about trap collection.

This has been discussed in #1184 and #1214. I opted not to go this route because I thought the &[TrapSite] version was easier. Experience has shown that was a mistake.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2020 at 17:28):

pchickey submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2020 at 17:35):

froydnj closed without merge PR #1389.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2020 at 17:35):

froydnj reopened PR #1389 from define-function-trap-sink to master:

Experience with the define_function API has shown that returning borrowed slices of TrapSite is not ideal: the returned slice represents a borrow on the entire Module, which makes calling back into methods taking &mut self a bit tricky.

To eliminate the problem, let's require the callers of define_function to provide TrapSink instances. This style of API enables them to control when and how traps are collected, and makes the object and faerie backends simpler/more efficient by not having to worry about trap collection.

This has been discussed in #1184 and #1214. I opted not to go this route because I thought the &[TrapSite] version was easier. Experience has shown that was a mistake.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2020 at 17:36):

froydnj merged PR #1389.


Last updated: Dec 23 2024 at 12:05 UTC