Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
darkpore
· 12y ago · 0 comments
You can get around a lot of these issues by reserving the size needed up front, or using a custom allocator with std::vector. Not as easy, but still doable.
The reallocation issue isn't fixable this way however...
Comments
[–]
thrownaway2424
12y ago
You can use a feedback directed optimization pass to choose the initial size.