Skip to content

Fix default allocator usage on Solaris in mqbs_filestoreprotocolutil test - #1209

Merged
hallfox merged 1 commit into
bloomberg:mainfrom
hallfox:fix-solaris-allocation
Mar 20, 2026
Merged

Fix default allocator usage on Solaris in mqbs_filestoreprotocolutil test#1209
hallfox merged 1 commit into
bloomberg:mainfrom
hallfox:fix-solaris-allocation

Conversation

@hallfox

@hallfox hallfox commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator

A couple default allocator calls were occurring due to a difference in behavior with bsl::make_pair on Solaris, meaning some bsl::string objects were being copied with the default allocator and during OrderedMap insertion due to the value_type being inferred as bsl::pair<K, V> instead of the correct type bsl::pair<const K, V>. The issue does not occur on Linux because these values are move constructed instead and that correctly chooses the right allocator.

…test

Signed-off-by: Taylor Foxhall <tfoxhall@bloomberg.net>
@hallfox
hallfox requested a review from a team as a code owner March 20, 2026 15:50

@pniedzielski pniedzielski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks fine, only the explicit construction of a value_type with an allocator argument and the subsequent .inserts are the relevant part.

Is this a bug in bsl::make_pair on Solaris, a bug in the compiler?

@hallfox

hallfox commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator Author

Not really a bug in make_pair so much as it is that std::make_pair doesn't support specifying the allocator to use on construction (and bsl::make_pair is an alias for std::make_pair)

@hallfox
hallfox merged commit 5e3d403 into bloomberg:main Mar 20, 2026
37 of 41 checks passed
@hallfox
hallfox deleted the fix-solaris-allocation branch March 20, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants