Skip to content

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

Merged
mjp41 merged 1 commit intomicrosoft:mainfrom
akrieger:export_new_delete
Mar 3, 2026
Merged

Add SNMALLOC_EXPORT annotation to c++ allocator functions.#822
mjp41 merged 1 commit intomicrosoft:mainfrom
akrieger:export_new_delete

Conversation

@akrieger
Copy link
Contributor

@akrieger akrieger commented Mar 2, 2026

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
Member

mjp41 commented Mar 3, 2026

@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
Copy link
Contributor Author

akrieger commented Mar 3, 2026

formatted

Copy link
Member

@mjp41 mjp41 left a comment

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