Skip to content

Add SNMALLOC_EXPORT annotation to c++ allocator functions. - #822

Merged
Matthew Parkinson (mjp41) merged 1 commit into
microsoft:mainfrom
akrieger:export_new_delete
Mar 3, 2026
Merged

Matthew Parkinson (mjp41) merged 1 commit into
microsoft:mainfrom
akrieger:export_new_delete

Conversation

@akrieger

@akrieger akrieger commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

CleverRaven/Cataclysm-DDA#85620 showed that when compiling snmalloc statically into a binary the new/delete overrides are stripped by strip by default because they appear unused. Add the existing SNMALLOC_EXPORT annotation to these functions so snmalloc can be used in combination with -fvisibility=hidden when overriding the c++ allocators, so that shared libraries use the overrides instead of loading the system default implementations.

@akrieger
akrieger force-pushed the export_new_delete branch from f3b7feb to 4fa3019 Compare March 2, 2026 23:03
@mjp41

Copy link
Copy Markdown
Member

akrieger could you clang-format.

@akrieger
akrieger force-pushed the export_new_delete branch from 4fa3019 to 7637b8c Compare March 3, 2026 17:01
@akrieger

akrieger commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

formatted

@mjp41 Matthew Parkinson (mjp41) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, I think the CI failures look like packaging issues with Mac. Nothing related to this PR.

@mjp41
Matthew Parkinson (mjp41) merged commit c2f0d1c into microsoft:main Mar 3, 2026
323 of 329 checks passed
@akrieger
akrieger deleted the export_new_delete branch March 3, 2026 22:40
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