-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
QE 2021-10-04, QE 2021-10-18, QE 2021-11-01
-
135
Currently, the buffer builder tries to be friendly with the system allocators and ask for powers of two allocations: https://github.com/10gen/mongo/blob/34bb8ccdba458e000b7b0ce7b6c0c157619fcdd6/src/mongo/bson/util/builder.h#L460-L462
However, then later down the function call chains, this power of two size is increased by a few bytes: https://github.com/10gen/mongo/blob/fcdc972cd6f64bfe710161fb3a0ffc4a5ca329d1/src/mongo/util/shared_buffer.h#L73
In this issue, we want to fix this behaviour and make sure that the end allocated size asked from the system allocator (https://github.com/10gen/mongo/blob/47b380f03e8898f4706ff01fa2be64dfb72e0dba/src/mongo/util/allocator.cpp#L47) is a power of two.
- related to
-
SERVER-60137 Improve Buffer Allocation for Common BSON-related Sizes
- Closed