roc-streaming / roc-toolkit

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

Extract RefCountedImpl class from RefCounted class #581

Closed gavv closed 9 months ago

gavv commented 9 months ago

core::RefCounted implements base class for reference countable objects. It is very widely used in the code base.

To reduce code size and compilation times, it would be great to move its methods to a non-template implementation class (everything except destroy() call in decref() because it depends on template parameters). All existing code will continue using RefCounted, however its methods will mostly just invoke similar methods of RefCountedImpl. This way, the template part will be small, and non-template part will be compiled once and reused.

We use the same approach with core::Pool and core::PoolImpl.

nolan-veed commented 9 months ago

I'll do this one.

gavv commented 9 months ago

Awesome

gavv commented 9 months ago

Merged