Skip to content
Discussion options

You must be logged in to vote

I'm referring to the monotonic_buffer_resource from the standard library (have a look at what's in std::pmr). If you have containers that only grow (ideally immutable after construction), they are a good choice. Although you might want to switch from vector to list in that case to avoid "holes" in the buffer (from growing a vector) unless you can always reserve the proper size right away.

As for other heap allocators like tcmalloc: it really depends on the allocation patterns in your application. Maybe plugging in an alternative malloc implementation will speed up your application enough. But the only thing I can recommend here is trying it out and measuring it.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@phil-skillwon
Comment options

@Neverlord
Comment options

Answer selected by phil-skillwon
@phil-skillwon
Comment options

@phil-skillwon
Comment options

@Neverlord
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants