summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2020-08-18 14:07:57 +0200
committerBert Belder <bertbelder@gmail.com>2020-08-18 20:50:52 +0200
commitf6e9150b33168ab8c5e48238860e2c3f3bf625f3 (patch)
tree8dd1c3767cf340f51e8bca0d9cc30bed2750954d /core
parentb308a774e81d7d18dfc2122459632f9ba9ae1eb8 (diff)
Async op dispatcher support with 'stateful_json_op_(a)sync()' (#7095)
Closes: #7020
Diffstat (limited to 'core')
-rw-r--r--core/lib.rs1
-rw-r--r--core/zero_copy_buf.rs3
2 files changed, 4 insertions, 0 deletions
diff --git a/core/lib.rs b/core/lib.rs
index 810025431..cd4a4eeee 100644
--- a/core/lib.rs
+++ b/core/lib.rs
@@ -51,6 +51,7 @@ pub use crate::ops::Op;
pub use crate::ops::OpAsyncFuture;
pub use crate::ops::OpId;
pub use crate::resources::ResourceTable;
+pub use crate::zero_copy_buf::BufVec;
pub use crate::zero_copy_buf::ZeroCopyBuf;
pub fn v8_version() -> &'static str {
diff --git a/core/zero_copy_buf.rs b/core/zero_copy_buf.rs
index a2625b8aa..053576547 100644
--- a/core/zero_copy_buf.rs
+++ b/core/zero_copy_buf.rs
@@ -1,8 +1,11 @@
use crate::bindings;
use rusty_v8 as v8;
+use smallvec::SmallVec;
use std::ops::Deref;
use std::ops::DerefMut;
+pub type BufVec = SmallVec<[ZeroCopyBuf; 2]>;
+
/// A ZeroCopyBuf encapsulates a slice that's been borrowed from a JavaScript
/// ArrayBuffer object. JavaScript objects can normally be garbage collected,
/// but the existence of a ZeroCopyBuf inhibits this until it is dropped. It