Release independent packages

- napi@3.0.0-alpha.19
This commit is contained in:
LongYinan 2024-10-31 11:06:23 +08:00
parent fd23549009
commit 59dce18ab4
No known key found for this signature in database
GPG Key ID: C3666B7FC82ADAD7
2 changed files with 7 additions and 1 deletions

View File

@ -8,7 +8,7 @@ name = "napi"
readme = "README.md"
repository = "https://github.com/napi-rs/napi-rs"
rust-version = "1.80"
version = "3.0.0-alpha.18"
version = "3.0.0-alpha.19"
[lib]
doctest = false

View File

@ -52,7 +52,10 @@ macro_rules! impl_typed_array {
finalizer_notify: *mut dyn FnOnce(*mut $rust_type, usize),
}
/// SAFETY: This is undefined behavior, as the JS side may always modify the underlying buffer,
/// without synchronization. Also see the docs for the `DerfMut` impl.
unsafe impl Send for $name {}
unsafe impl Sync for $name {}
impl Finalizer for $name {
type RustType = $rust_type;
@ -259,6 +262,9 @@ macro_rules! impl_typed_array {
}
}
/// SAFETY: This is literally undefined behavior. `Buffer::clone` allows you to create shared
/// access to the underlying data, but `as_mut` and `deref_mut` allow unsynchronized mutation of
/// that data (not to speak of the JS side having write access as well, at the same time).
impl DerefMut for $name {
fn deref_mut(&mut self) -> &mut Self::Target {
self.as_mut()