[SERVER-60115] Fix the Buffer Builder to Correctly use Powers of Two Allocations Created: 21/Sep/21 Updated: 29/Oct/23 Resolved: 21/Oct/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.2.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Mohammad Dashti (Inactive) | Assignee: | Mohammad Dashti (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | QE 2021-10-04, QE 2021-10-18, QE 2021-11-01 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 135 | ||||||||||||
| Description |
|
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. |
| Comments |
| Comment by Githook User [ 24/Oct/21 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: This removes MONGO_COMPILER_NOINLINE from Builder::_growReallocate(). The no-inline directive This function was originally moved out of line in commit f6d863188b71b420f13b8249579d34de76d80d9c |
| Comment by Githook User [ 21/Oct/21 ] |
|
Author: {'name': 'Mohammad Dashti', 'email': 'mdashti@gmail.com', 'username': 'mdashti'}Message: |