Expand description
Batteries included solution to using reference counted values on the audio-thread.
Wraps basedrop
so that smart pointers are dropped on a background thread. Exposes a default
global GC thread and helpers to create pointers attached to it.
§Collection frequency
Collection is based on polling the queue every 100ms by default.
If references are created and dropped very frequently this strategy is not adequate. This also adds some small overhead.
Structs§
- Garbage
Collector - Wraps
basedrop::Collector
with a polling GC thread. - Handle
- A handle to a
Collector
, used when allocatingOwned
andShared
values. - Owned
- An owned smart pointer with deferred collection, analogous to
Box
. - Shared
- A reference-counted smart pointer with deferred collection, analogous to
Arc
. - Shared
Cell - A thread-safe shared mutable memory location that holds a
Shared<T>
.
Enums§
- Garbage
Collector Error - Errors that may be emitted when stopping the GC
Functions§
- current
- Return a reference to a global GC instance
- handle
- Return a handle to a global GC instance
- make_
shared - Create a new
basedrop::Shared
value using the default globalGarbageCollector
instance. - make_
shared_ cell - Create a new
basedrop::SharedCell
value using the default globalGarbageCollector
instance.