diff options
author | Andreu Botella <andreu@andreubotella.com> | 2022-07-11 17:27:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 17:27:33 +0200 |
commit | 018ad9b3a4f2e5c8597274f61262c6035bdb560d (patch) | |
tree | 5dba5fd5a9a9e8fd818532b66ead5c5721e32508 /core/lib.rs | |
parent | 83c9714fb2f401e82a6c2e784a43130818e8282d (diff) |
chore(web, worker): Use `DetachedBuffer` for `postMessage` ops (#15133)
This commit uses `DetachedBuffer` instead of `ZeroCopyBuf` in the ops
that back `Worker.prototype.postMessage` and
`MessagePort.prototype.postMessage`. This is done because the
serialized buffer is then copied to the destination isolate, even
though it is internal to runtime code and not used for anything else,
so detaching it and transferring it instead saves an unnecessary copy.
Diffstat (limited to 'core/lib.rs')
-rw-r--r-- | core/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/lib.rs b/core/lib.rs index 064c15fc1..ab22392c4 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -27,6 +27,7 @@ pub use serde; pub use serde_json; pub use serde_v8; pub use serde_v8::ByteString; +pub use serde_v8::DetachedBuffer; pub use serde_v8::StringOrBuffer; pub use serde_v8::U16String; pub use serde_v8::ZeroCopyBuf; |