Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Use Smart Pointers in AudioIO and RealtimeEffectManager #52

Open
generic-pers0n opened this issue Aug 25, 2022 · 0 comments
Open

Use Smart Pointers in AudioIO and RealtimeEffectManager #52

generic-pers0n opened this issue Aug 25, 2022 · 0 comments
Assignees
Labels
cleanups Involves code cleanups

Comments

@generic-pers0n
Copy link
Member

Is your feature request related to a problem? Please describe.
Tenacity PR 412 and Tenacity PR 418 have attempted to remove usage of alloca() in AudioIO and RealtimeEffectManager in PR 412. However, there might have been possible memory leaks in this fix, which is why 418 was introduced to fix some of these issues.

I have implemented a similar fix, except this is throughout the rest of the code. This is what StackAllocator was for. However, as I prefer the use of smart pointers, I've also made changes to utilize those instead. However, this wasn't entirely consistent because utilizing smart pointers right now makes for some...less than pleasant-looking code.

Using smart pointers from the start in AudioIO and RealtimeEffectManager will allow for cleaner code while not having to deal with possible memory leaks (or reducing them as much as possible).

Describe the solution you'd like
Ideally, we'd use smart pointers and maybe weak references in addition to more RAII semantics. I prefer the use of more standard smart pointers than our own solutions (e.g. StackAllocator) as much as possible.

Describe alternatives you've considered
I have not given this much thought, unfortunately, but here's something that I have below:

We could alwayys implement our own solution for these fixes as an alternative. Beyond just regular smart pointers, we could possibly implement tricks within these solutions too if need be.

@generic-pers0n generic-pers0n added the cleanups Involves code cleanups label Sep 21, 2022
@generic-pers0n generic-pers0n self-assigned this Sep 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cleanups Involves code cleanups
Projects
None yet
Development

No branches or pull requests

1 participant