Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to control the chunk size of `std::deque` when allocating a new chunk?

When we insert a new element into a std::deque, it may allocate a new chunk to contain the element if the existing chunks are all full.

However, how does the implementation control the chunk size?

Is it possible for the user to control the chunk size? or it just depends on the implementation's choice, e.g. 4K or 8K?

like image 723
xmllmx Avatar asked Jun 30 '14 04:06

xmllmx


1 Answers

This is a chosen value of the implementation, and there is no control over it.

For example Microsoft choose values of 16 or smaller for the number of elements in a block. (Search for _DEQUESIZ).

like image 114
mksteve Avatar answered Nov 02 '22 01:11

mksteve