Skip to content

Commit

Permalink
Tidy zero_copy, and leave a note explaining that it isn't
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmcsherry committed Aug 20, 2024
1 parent ef3c822 commit b86b8be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions communication/src/allocator/zero_copy/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
//! Allocators based on serialized data which avoid copies.
//!
//! These allocators are based on `Abomonation` serialization, and its ability to deserialized
//! typed Rust data in-place. They surface references to data, often ultimately referencing the
//! These allocators were based on `Abomonation` serialization, and its ability to deserialized
//! typed Rust data in-place. They surfaced references to data, often ultimately referencing the
//! raw binary data they initial received.
//!
//! For the moment, they no longer use Abomonation due to its unsafety, and instead rely on the
//! use of `Message::from_bytes` which .. could .. use Abomonation or something safer, but uses
//! `bincode` at of this writing.

pub mod bytes_slab;
pub mod bytes_exchange;
Expand Down
4 changes: 2 additions & 2 deletions communication/src/allocator/zero_copy/push_pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl<T:Data> Pull<Message<T>> for Puller<T> {
self.receiver
.borrow_mut()
.pop_front()
.map(|bytes| Message::from_bytes(bytes));
.map(Message::from_bytes);

&mut self.current
}
Expand Down Expand Up @@ -134,7 +134,7 @@ impl<T:Data> Pull<Message<T>> for PullerInner<T> {
self.receiver
.borrow_mut()
.pop_front()
.map(|bytes| Message::from_bytes(bytes));
.map(Message::from_bytes);

&mut self.current
}
Expand Down

0 comments on commit b86b8be

Please sign in to comment.