#heap #dynamic #pointers #store #object #fields #containing

nightly compact

Store objects containing dynamic fields either compactly in consecutive memory or using traditional heap pointers

18 releases

Uses old Rust 2015

0.2.16 Aug 25, 2020
0.2.15 Jul 9, 2019
0.2.13 Sep 26, 2018
0.2.7 Aug 12, 2018
0.1.0 Jul 5, 2018

#429 in Memory management

35 downloads per month
Used in 3 crates

MIT license

79KB
2K SLoC

This crate makes it possible to store objects containing dynamic fields either compactly in consecutive memory or using traditional heap pointers.

Bread-and-butter datastructures are offered, they feature:

  • transparent access semantics, independent of currently used storage
  • automatic spill from exhausted compact storage to heap storage
  • recursive re-compaction

This is used in Kay for:

  • Storing actor state compactly in one place for cache coherency and easy persistence
  • Sending complex, dynamically-sized messages over boundaries such as actors, threads and the network

Dependencies

~1MB
~19K SLoC