#background-thread #reference-counting #smart-pointers #audio #values #gc #collection

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

#248 in Memory management

Download history 58/week @ 2023-12-04 53/week @ 2023-12-11 50/week @ 2023-12-18 55/week @ 2023-12-25 10/week @ 2024-01-01 43/week @ 2024-01-08 99/week @ 2024-01-15 24/week @ 2024-01-22 15/week @ 2024-01-29 33/week @ 2024-02-05 49/week @ 2024-02-12 71/week @ 2024-02-19 61/week @ 2024-02-26 56/week @ 2024-03-04 57/week @ 2024-03-11 88/week @ 2024-03-18

263 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.4–2.3MB
~46K SLoC