mardi 30 décembre 2014

How to implement a custom allocator to be used with std::map?

I'm looking for some pointers on how to implement a custom allocator to be used with a std::map. I'm interested on populating a map with millions of entries without having an allocation for each element in the container (which is the default for this container). The reason for this is to pass data to a third party library that is using a map to store samples of a chart (QCustomPlot) and I'm feeling the performance hit when plotting large time series.


Is it possible to do this with one allocation if the size of the std::map is known in advance?


Aucun commentaire:

Enregistrer un commentaire