roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.02k stars 203 forks source link

No-op implementation of IArena #691

Closed gavv closed 4 months ago

gavv commented 4 months ago

core::IArena is an interface that abstracts heap-like allocator. It is typically implemented by core::HeapArena.

We have two classes that can be constructed either with or without IArena: core::Array and core::Hashmap. When constructed with arena, they use it to grow dynamically, otherwise they can only store data that fits within embedded capacity. The latter is used when we need container but want to be sure that it never allocates.

It would be nice to make this second feature a bit more explicit, and instead of a constructor overload without IArena, use a special arena that does not allocate.

Steps:

nolan-veed commented 4 months ago

I took the liberty of doing this.

gavv commented 4 months ago

Thanks!