From dd1360f22b3d32053c41a304a1128978f624cac1 Mon Sep 17 00:00:00 2001 From: TimLuq Date: Wed, 7 Aug 2024 00:08:52 +0200 Subject: [PATCH] increase region count for `ByteQueue` as the `ByteData` size was lowered to 16 bytes --- src/queue/linked_node_data.rs | 8 +++++++- src/shared_bytes_builder.rs | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/queue/linked_node_data.rs b/src/queue/linked_node_data.rs index dd94d27..847e9f0 100644 --- a/src/queue/linked_node_data.rs +++ b/src/queue/linked_node_data.rs @@ -2,8 +2,14 @@ use core::mem::MaybeUninit; use crate::ByteData; +#[cfg(feature = "alloc")] +const NODE_SIZE: usize = 15; + +#[cfg(not(feature = "alloc"))] +const NODE_SIZE: usize = 23; + pub(super) struct LinkedNodeData<'a> { - pub(super) data: [MaybeUninit>; 8], + pub(super) data: [MaybeUninit>; NODE_SIZE], pub(super) beg: u8, pub(super) len: u8, } diff --git a/src/shared_bytes_builder.rs b/src/shared_bytes_builder.rs index e7c8131..24d0124 100644 --- a/src/shared_bytes_builder.rs +++ b/src/shared_bytes_builder.rs @@ -34,6 +34,10 @@ impl SharedBytesBuilder { } /// Creates a new `SharedBytesBuilder`. + /// + /// # Panics + /// + /// Panics if the alignment is not a power of two or is greater than 512 or the maximum allowed by the system. #[inline] #[must_use] pub const fn with_alignment(alignment: usize) -> Self {