Skip to main content

ChunkVec

Struct ChunkVec 

Source
struct ChunkVec<T> {
    chunks: Vec<Vec<T>>,
    len: usize,
}
Expand description

一定数ずつの塊に分けた配列(添字で引ける)。

【2026-10-24】回収の作業用の配列(節点・状態)を 1 本で確保していたため、生存数が 100 万を超えると 約 19MB の連続領域を要し、断片化したヒープ(使用 520MB / 704MB)で確保に失敗してブラウザが落ちた。

Fields§

§chunks: Vec<Vec<T>>§len: usize

Implementations§

Source§

impl<T> ChunkVec<T>

Source

const fn new() -> Self

Source

fn push(&mut self, v: T)

Source

fn len(&self) -> usize

Source

fn get(&self, i: usize) -> Option<&T>

Source

fn get_mut(&mut self, i: usize) -> Option<&mut T>

Source

fn iter(&self) -> impl Iterator<Item = &T>

Source§

impl<T: Copy> ChunkVec<T>

Source

fn filled(n: usize, v: T) -> Self

Trait Implementations§

Source§

impl<T> Index<usize> for ChunkVec<T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, i: usize) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<T> IndexMut<usize> for ChunkVec<T>

Source§

fn index_mut(&mut self, i: usize) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<T> Freeze for ChunkVec<T>

§

impl<T> RefUnwindSafe for ChunkVec<T>
where T: RefUnwindSafe,

§

impl<T> Send for ChunkVec<T>
where T: Send,

§

impl<T> Sync for ChunkVec<T>
where T: Sync,

§

impl<T> Unpin for ChunkVec<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for ChunkVec<T>

§

impl<T> UnwindSafe for ChunkVec<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.