ManagedBuffer.capacity is unavailable on OpenBSD.#456
Merged
lorentey merged 2 commits intoapple:mainfrom May 15, 2025
Merged
Conversation
ManagedBuffer.capacity depends on malloc introspection (e.g., `malloc_size`), which is not available on this platform -- and is thus marked as such. Here, _HashNode.Storage is a ManagedBuffer. Thankfully, the uses of .capacity are fairly limited: one for statistic purposes, which we just completely omit on the platform, and the other, setting a minimum capacity in the header by the buffer's .capacity; the alternative being setting that minimum capacity directly.
Contributor
Author
|
@swift-ci please test. |
lorentey
approved these changes
May 2, 2025
Member
lorentey
left a comment
There was a problem hiding this comment.
Thanks! I noted a small adjustment we should make on all platforms.
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
Contributor
Author
|
@swift-ci please test. |
Contributor
Author
|
Applied your suggestion. Please merge on my behalf if there's nothing else, thanks! |
Contributor
Author
|
@lorentey ping on the merge if that's OK :) |
Contributor
Author
|
@lorentey ping again on merging, if there's nothing else, thank you! |
lorentey
approved these changes
May 15, 2025
Member
|
I'll cherry pick this to the release/1.2 branch, in a separate (bulk) PR |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ManagedBuffer.capacity depends on malloc introspection (e.g.,
malloc_size), which is not available on this platform -- and is thus marked as such.Here, _HashNode.Storage is a ManagedBuffer. Thankfully, the uses of .capacity are fairly limited: one for statistic purposes, which we just completely omit on the platform, and the other, setting a minimum capacity in the header by the buffer's .capacity; the alternative being setting that minimum capacity directly.
Checklist