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?
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).