-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Runtime] Don't cache malloc_default_zone. #66305
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
[Runtime] Don't cache malloc_default_zone. #66305
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine
@swift-ci please test and merge |
@swift-ci please test macos platform |
I like this! |
stdlib/public/runtime/Heap.cpp
Outdated
} else { | ||
size_t alignment = computeAlignment(alignMask); | ||
p = malloc_type_zone_memalign(DEFAULT_ZONE(), alignment, size, typeId); | ||
malloc_type_memalign(&p, alignment, size, typeId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use malloc_type_aligned_alloc
to avoid memalign
's awkward interface (out parameter) and the need to initialize p
(which makes it different from the original swift_slowAlloc
function above).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, I was looking for “memalign” specifically and missed that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And fixed.
Caching the default zone should no longer be necessary. rdar://102870625
3c0dec3
to
007ac9a
Compare
@swift-ci please smoke test and merge |
Caching the default zone should no longer be necessary.
rdar://102870625