pub struct ChunkedVec<T> {
chunks: Vec<Vec<T>>,
len: usize,
}Expand description
固定長の塊を並べた追記専用の配列(索引で引ける)。
【2026-10-19】YouTube の視聴ページの kevlar_base(10.8MB、約 320 万トークン)で、
Vec<Token> が倍々に伸びて 128MB の連続領域を要求し、ヒープ(512MB、使用 325MB)で
確保に失敗していた。塊(CHUNK 個)ごとに確保すれば、大きな連続領域も、伸長時の
旧・新の二重持ちも要らない。
Fields§
§chunks: Vec<Vec<T>>§len: usizeImplementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ChunkedVec<T>
impl<T> RefUnwindSafe for ChunkedVec<T>where
T: RefUnwindSafe,
impl<T> Send for ChunkedVec<T>where
T: Send,
impl<T> Sync for ChunkedVec<T>where
T: Sync,
impl<T> Unpin for ChunkedVec<T>where
T: Unpin,
impl<T> UnsafeUnpin for ChunkedVec<T>
impl<T> UnwindSafe for ChunkedVec<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more