Re: [whatwg/encoding] New TextDecoder.decode() API needed for Wasm multithreading (#172)

For SAB-compatibility: is that as simple as adding [AllowShared] to decode?

Regarding the garbage created by temporary views, it is a distinct goal of the [Host Bindings](https://github.com/WebAssembly/host-bindings/blob/master/proposals/host-bindings/Overview.md) proposal (explainer quite outdated; refresh coming soon) which we've re-started focusing on recently, including others from the Google Emscripten team like @jgravelle-google.  Basically, wasm should be able to pass two `i32`s that get coerced into a view that is never actually GC-allocated since it is immediately consumed by a C++ implementation that just wants a (base*,length) pair.  See also the discussion for [encodeInto](https://github.com/whatwg/encoding/issues/69) where we are critically assuming this Host Bindings capabilities for what would otherwise by very garbage-producing API.

For the null-terminating use case: yes, I can definitely see the utility in specifying a terminating code point (like null) to avoid an otherwise superfluous scan through the string.  Maybe we can focus on that use case?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/172#issuecomment-461247052

Received on Thursday, 7 February 2019 00:45:10 UTC