Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Multi-index] empty container allocates 1 unused node
From: Jakub Jablonski (jakub.jablonski_at_[hidden])
Date: 2010-03-04 09:11:57


Hi,
I was trying out some examples of using multi_index_container with custom allocator. I found out that even an empty container, on creation, allocates memory for a single node (but no element is stored inside).
In other words, if I store N elements, the container allocates memory for N+1 elements.

Is it a fault?
If not, what is this memory used for?
Is there any way to avoid this allocation?

Regards,
Jakub


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net