Skip to content
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

[SR-14886] UnsafeMutableRawBufferPointer.copyBytes copies byte by byte (even when contiguous form available) #57233

weissi opened this issue Jul 7, 2021 · 3 comments


Copy link

@weissi weissi commented Jul 7, 2021

Previous ID SR-14886
Radar rdar://problem/80260173
Original Reporter @weissi
Type Bug
Status Closed
Resolution Done

today's main branch.

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, Performance, StarterBug
Assignee wongzigii (JIRA)
Priority Medium

md5: fd0f6279a58da9175d769c554d5eac61

Issue Description:

The code for UMRBP.copyBytes which takes a Collection of {{UInt8}}s elements and copies them into the buffer fails to see if there's a contiguous representation available.

It should just try withContiguousStorageIfAvailable and fall back onto byte by byte if that returns nil.

Copy link
Member Author

@weissi weissi commented Jul 7, 2021

@swift-ci create

Copy link

@swift-ci swift-ci commented Jul 17, 2021

Comment by Zigii Wong (JIRA)


Copy link

@glessard glessard commented Jul 21, 2021

For what it's worth, UMRBP.initializeMemory(as: from: ) has a similar flaw.


@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

3 participants