-
Notifications
You must be signed in to change notification settings - Fork 281
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
Support for allocation customization #2051
Comments
I guess this could also be much faster. |
Sounds interesting. Do you have any example of how this would work? |
I think it's only feasible if you can also control allocation for all dependencies as well, or at least the subset in use based on the library configuration, and are willing to accept an increase in complexity. Here is video that introduces the pmr model a bit - there's an associated playlist as well. And an article which explains the model. Hopefully this example that orders elements in containers could provide some ideas for how it could be applied to this library: https://gcc.godbolt.org/z/sEf1nKW48 |
Sounds like it might be worthwhile. A compile time option that goes into This is probably no small project though. But if you can make it work, I'd be curious to see how our benchmarks are affected when using e.g. monotonic_buffer from std::pmr. What worries me is that any API that currently allocates would now also need an extra argument (accepting the allocator instance). That might prove to be a prohibitively intrusive. |
I imagine you could do this without needing generate
At least now, I'm happy to help on this, but a large cost will go into ramp up. Maybe a start would be some sort of collaboration that is first focused on documenting some of the internals? That would also help other new contributors in the future.
The private APIs would need to pass around allocator instances, but the public APIs should have overloads that can use a default constructed allocator value, allow a user to ignore allocator customization unless that feature is necessary. |
@bjodah Here's an example of how you could use a variable template, defined at the beginning of the user program, to configure the allocator. You could use probably use Footnotes |
Is there any desire to support allocator customization? I could imagine two uses cases:
pmr
could be used as a replacement in this situation.The text was updated successfully, but these errors were encountered: