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-13712] Data.init([UInt8]) should steal the array storage if possible #3243

Open
belkadan opened this issue Oct 8, 2020 · 1 comment
Open

Comments

@belkadan
Copy link

belkadan commented Oct 8, 2020

Previous ID SR-13712
Radar rdar://problem/70123868
Original Reporter @belkadan
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Improvement
Assignee None
Priority Medium

md5: c6ef43986d73b96f63c835686d7777b6

Issue Description:

As an optimization, initializing a Data with a uniquely-owned Swift Array should avoid copying the data out of the Array. This would probably require coordination with the standard library to expose Array-to-buffer and buffer-to-Array intrinsics, but could be useful making APIs that accept Data play more nicely with APIs that produce Arrays.

@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
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

2 participants