Skip to content

Add a SWIFT_STDLIB_HAS_DARWIN_LIBMALLOC flag to allow/disallow uses of Darwin libmalloc APIs (malloc_default_zone, malloc_zone_malloc, etc.) #33812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2021

Conversation

kubamracek
Copy link
Contributor

No description provided.

@kubamracek kubamracek requested a review from mikeash September 4, 2020 23:56
@kubamracek
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Sep 5, 2020

Build failed
Swift Test OS X Platform
Git Sha - ebc733b952d4d4ba87915173555900d1ae71aa8d

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Sep 5, 2020

Build failed
Swift Test OS X Platform
Git Sha - ebc733b952d4d4ba87915173555900d1ae71aa8d

@swift-ci
Copy link
Contributor

swift-ci commented Sep 5, 2020

Build failed
Swift Test Linux Platform
Git Sha - ebc733b952d4d4ba87915173555900d1ae71aa8d

@kubamracek
Copy link
Contributor Author

@swift-ci please test stdlib with toolchain

@@ -601,7 +601,8 @@ template <class ElemTy> struct ConcurrentReadableHashMap {
/// Otherwise, just return the passed-in size, which is always valid even if
/// not necessarily optimal.
size_t goodSize(size_t size) {
#if defined(__APPLE__) && defined(__MACH__)
#if defined(__APPLE__) && defined(__MACH__) && \
defined(SWIFT_STDLIB_HAS_DARWIN_LIBMALLOC)
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll want this to just be SWIFT_STDLIB_HAS_DARWIN_LIBMALLOC (no defined() around it) to handle the case where it's 0.

@kubamracek kubamracek changed the base branch from master to main September 23, 2020 22:20
…f Darwin libmalloc APIs (malloc_default_zone, malloc_zone_malloc, etc.)
@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek kubamracek merged commit aaff37f into swiftlang:main Aug 24, 2021
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.

3 participants