Skip to content

Commit

Permalink
feat: BufMut with custom allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
Alxandr committed Nov 3, 2024
1 parent 8310013 commit 4a86774
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/aligned-buffer/src/bytes.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use crate::{raw::RawAlignedBuffer, UniqueAlignedBuffer};
use crate::{alloc::BufferAllocator, raw::RawAlignedBuffer, UniqueAlignedBuffer};
use bytes::{buf::UninitSlice, Buf, BufMut};
use std::ptr;

unsafe impl<const ALIGNMENT: usize> BufMut for UniqueAlignedBuffer<ALIGNMENT> {
unsafe impl<const ALIGNMENT: usize, A: BufferAllocator<ALIGNMENT>> BufMut
for UniqueAlignedBuffer<ALIGNMENT, A>
{
#[inline]
fn remaining_mut(&self) -> usize {
RawAlignedBuffer::<ALIGNMENT>::MAX_CAPACITY - self.len()
Expand Down

0 comments on commit 4a86774

Please sign in to comment.