aboutsummaryrefslogtreecommitdiff
path: root/src/batch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/batch.rs')
-rw-r--r--src/batch.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/batch.rs b/src/batch.rs
index b5c88b8..980194b 100644
--- a/src/batch.rs
+++ b/src/batch.rs
@@ -33,6 +33,7 @@ impl Batch {
pub fn new() -> Self {
// TODO: use a pinned Box ?
let mut buf = Box::new(Vec::with_capacity(default_batch_page_size() as usize));
+ // Safe because we hold onto the buffer for as long as `writer` exists
let mut writer = NfNetlinkWriter::new(unsafe {
std::mem::transmute(Box::as_mut(&mut buf) as *mut Vec<u8>)
});