thinarray 0.2.0

A thin alternative to Box<[T]>
Documentation
  • Coverage
  • 0%
    0 out of 18 items documented0 out of 17 items with examples
  • Size
  • Source code size: 8.68 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.68 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • malucard

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.