Module rafx_base::slab [−][src]
Several slab types with their own APIs/tradeoffs.
Some attempt is made to have the reuse/build on each other. For example:
- KeyedRcSlab -> RcSlab -> GenSlab
GenSlab probably could contain a RawSlab, but doesn’t for now
Most operations are O(1), but there is risk of having to resize a vector. It’s recommended in a shipped game that you pre-allocate the size you need to avoid this.
Structs
DropSlab | Wraps a RawSlab with reference counting handles. When the handle is dropped it sends a message to the slab. We process these messages to remove old elements |
DropSlabKey | |
RawSlab | A very simple, minimalist slab structure. Consider using one of the other slabs instead as they are less error prone for many use-cases. |
RawSlabKey | A key to a value in a RawSlab |
Type Definitions
GenerationCounterT | TODO: In debug mode, we could put protections for using a key with the wrong slab TODO: Better diagnostics/tracking Scalar type for tracking element generation |
SlabIndexT | Scalar type for the count of elements of a T |