How to control the chunk size of `std::deque` when

2019-04-24 17:02发布

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?

1条回答
太酷不给撩
2楼-- · 2019-04-24 17:16

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

查看更多
登录 后发表回答