Expand description
Helpers for reference counting
Two main purposes:
- Consistent handling of overflow and underflow
- Assurance of incrementing/decrementing as appropriate, including in combination with a slotmap containing the referenced data.
The caller is responsible for making sure that the right instanceβs
Count is passed to the methods on Ref.
MacrosΒ§
- slotmap_
dec_ πref - Decrement a refcount and maybe remove a corresponding slotmap entry
StructsΒ§
- Count π
- A reference count, counting references with id type
K - Garbage π
- Something which has become garbage
- Overflow π
- Error: refcount overflowed
- Ref π
- An copy of a
slotmap_careful::KeyK, which is counted by aRefCount
FunctionsΒ§
- dec_raw π
- Decrement this refcount, but donβt care about any
Refs - inc_raw π
- Increment this refcount, but donβt care about any
Refs - slotmap_
insert π - Insert a new entry into a slotmap using refcounted keys
- slotmap_
remove_ πearly - Unconditionally remove en entry from the slotmap, given a strong ref
- slotmap_
try_ πinsert - Insert a new entry into a slotmap using refcounted keys, fallibly and with extra data
Type AliasesΒ§
- RawCount π
- Local alias for the counter type