thinarray

Crates.iothinarray
lib.rsthinarray
version0.1.0
sourcesrc
created_at2024-08-24 07:39:55.094856
updated_at2024-08-24 07:39:55.094856
descriptionA thin alternative to Box<[T]>
homepage
repository
max_upload_size
id1349922
size8,799
malucart (malucard)

documentation

README

ThinArray

This is a thin array type, meant to be an alternative to Box<[T]> when you have more arrays than actual data in them. It's only as big as one usize, and doesn't allocate for an empty array. It stores the array length with the data, whereas Box<[T]> stores it with the pointer. That helps with memory usage in many cases, with only the minor downside that accessing the length needs one more pointer indirection, unless it's 0. is_empty avoids that indirection.

Commit count: 0

cargo fmt