audio-garbage-collector

Wrapper on top of basedrop that provides a drop-in GC API that’ll collect reference-counted values on a background thread

9 releases (3 stable)

1.2.0 Apr 19, 2023
1.1.1 Mar 22, 2023
1.1.0 Sep 22, 2022
1.0.0-alpha.5 May 25, 2022
1.0.0-alpha.2 Jan 15, 2022
Download history 63/week @ 2024-06-18 43/week @ 2024-06-25 38/week @ 2024-07-02 68/week @ 2024-07-09 61/week @ 2024-07-16 48/week @ 2024-07-23 63/week @ 2024-07-30 47/week @ 2024-08-06 75/week @ 2024-08-13 84/week @ 2024-08-20 93/week @ 2024-08-27 49/week @ 2024-09-03 53/week @ 2024-09-10 38/week @ 2024-09-17 66/week @ 2024-09-24 53/week @ 2024-10-01

212 downloads per month
Used in 19 crates (12 directly)

MIT license

12KB
190 lines

audio-garbage-collector

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. If references are created and dropped very frequently this will not be adequate.

License: MIT


lib.rs:

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.

Dependencies

~0.3–2.3MB
~45K SLoC