Skip to content

Commit 6a9db71

Browse files
committed
fix: adjust SmallToken to 32 bytes according to tinyvec memory layout
1 parent 06a19e1 commit 6a9db71

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/token.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ use tinyvec::TinyVec;
99
pub type TokenId = u32;
1010
pub type SortedTokenId = u32;
1111

12-
pub type SmallToken = TinyVec<[u8; 29]>;
12+
pub type SmallToken = TinyVec<[u8; 28]>;
13+
14+
const _: () = [(); 1][(core::mem::size_of::<SmallToken>() == 32) as usize ^ 1];
1315

1416
#[derive(Clone, Debug, Default, PartialEq, Eq)]
1517
#[cfg_attr(feature = "pyo3", pyo3::pyclass(get_all, set_all))]

0 commit comments

Comments
 (0)