std::deque memory usage - Visual C++, and comparison to others
问题 Follow up to What the heque is going on with the memory overhead of std::deque? Visual C++ manages deque blocks according to the container element type using this: #define _DEQUESIZ (sizeof (value_type) <= 1 ? 16 \ : sizeof (value_type) <= 2 ? 8 \ : sizeof (value_type) <= 4 ? 4 \ : sizeof (value_type) <= 8 ? 2 \ : 1) /* elements per block (a power of 2) */ This results in very large memory footprint for small elements. By changing the 16 in the first line to 128 I was able to drastically