Real-Time Garbage Collector
A simple garbage collector which collects resources that are dropped on a realtime thread and then safely deallocates them on another thread.
The performance characteristics of the provided smart pointers are equivalant to Arc when reading (but constructing them is a bit more expensive).
This crate also optionally supports no_std through the use of bevy_platform.
This crate is similar to basedrop, except that it uses a simpler algorithm which uses standard library types as much as possible to greatly reduce the amount of internal unsafe code. (It is also not susceptible to memory leaks.) The drawback is that the collection pass is a bit more expensive than basedrop's implementation.
Example
use Duration;
use *;
let value_1 = new;
// Same as `ArcRt` but for `!Sync` data.
let value_2 = new;
// A simulated "realtime thread"
let rt_thread = spawn;
// A simulated update loop on the main thread
for _ in 0..4
You can also use a non-static collector with LocalRtGc (enabled in the local_collector feature).