#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

#329 in Memory management

Download history 57/week @ 2024-03-11 88/week @ 2024-03-18 106/week @ 2024-03-25 95/week @ 2024-04-01 51/week @ 2024-04-08 60/week @ 2024-04-15 122/week @ 2024-04-22 83/week @ 2024-04-29 55/week @ 2024-05-06 61/week @ 2024-05-13 67/week @ 2024-05-20 45/week @ 2024-05-27 47/week @ 2024-06-03 62/week @ 2024-06-10 55/week @ 2024-06-17 56/week @ 2024-06-24

222 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.2MB
~46K SLoC