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

Closed
weissi opened this issue Jul 7, 2021 · 3 comments

Comments

@weissi
Copy link
Member

@weissi weissi commented Jul 7, 2021

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

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.

@weissi
Copy link
Member Author

@weissi weissi commented Jul 7, 2021

@swift-ci create

@swift-ci
Copy link
Collaborator

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

Comment by Zigii Wong (JIRA)

#38463

@glessard
Copy link
Contributor

@glessard glessard commented Jul 21, 2021

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

SR-14982

@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
Projects
None yet
Development

No branches or pull requests

3 participants