Phelodas
Phelodas

Reputation: 4183

Custom Allocator in tr1's unordered_map

I have a few problems regarding a custom allocator for an unordered_map. I have a large dataset and I need to hash on a string as key. So I came to know that providing a custom memory allocator would optimize the speed. But how do I do that? (I checked SO but I could not find anything regarding the use of a custom allocator, although there are some stuff related to custom hash functions and so on)

Also what does unordered_map::size() return? It says its the longest controlled sequence. I was confused by what that means. Is it the number of buckets itself or is it something else?

Thanks a lot

Upvotes: 3

Views: 3017

Answers (1)

A. K.
A. K.

Reputation: 38126

if you haven't got the answer by now you'd like to check

http://en.cppreference.com/w/cpp/container/unordered_map

and for allocators you'd like to check

http://www.sgi.com/tech/stl/Allocators.html

Upvotes: 1

Related Questions