Skip to content

Make the allocator optional #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bifurcation opened this issue Apr 21, 2025 · 0 comments
Open

Make the allocator optional #50

bifurcation opened this issue Apr 21, 2025 · 0 comments

Comments

@bifurcation
Copy link
Contributor

In an effort to not depend on the C++ allocator, #47 introduced custom vector<T, N> and map<K, V, N> types, which use fixed-size stack-allocated storage. This has a couple of unfortunate side effects . First, the vector and map types have to be exposed to callers, when they're really intended as internal implementation details. Second, callers are locked into whatever fixed limits these types have, unable to benefit from extra memory on machines that have it.

We should enable the caller to choose whether to use fixed or dynamic allocations, and if fixed, how big the storage should be. Ideally, in a way that hides the fine-grained vector and map types. For example, we might define an abstract class KeyStorage and have the caller provide an instance as a pointer or reference. This would be somewhat analogous to the approach libsrtp took with regard to stream list storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant