#background-thread #reference-counting #audio #smart-pointers #gc #values #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

#665 in Memory management

Download history 59/week @ 2024-07-21 51/week @ 2024-07-28 45/week @ 2024-08-04 75/week @ 2024-08-11 42/week @ 2024-08-18 117/week @ 2024-08-25 67/week @ 2024-09-01 53/week @ 2024-09-08 39/week @ 2024-09-15 62/week @ 2024-09-22 51/week @ 2024-09-29 44/week @ 2024-10-06 52/week @ 2024-10-13 40/week @ 2024-10-20 38/week @ 2024-10-27 58/week @ 2024-11-03

190 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.4MB
~47K SLoC