swiftlang / swiftlang/swift-corelibs-libdispatch
[SR-7544] DispatchData.makeIterator allocates
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 2.6k
- Forks
- 496
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
| Previous ID | SR-7544 |
| Radar | None |
| Original Reporter | @weissi |
| Type | Bug |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | libdispatch |
| Labels | Bug |
| Assignee | None |
| Priority | Medium |
md5: 9ba6a5339e9d33535d2674b00231b88f
Issue Description:
-
DispatchDataIteratorcreates a__DispatchDatain its initialiser (https://github.com/apple/swift-corelibs-libdispatch/blob/a618b468b94ad6abb14a19af76e33018700af6bc/src/swift/Data.swift#L325) -
__DispatchDatais aclass(https://github.com/apple/swift-corelibs-libdispatch/blob/1457de8a6b714a30213e908cad0ce2d03f0459d6/src/swift/Wrapper.swift#L190)
--> iterating a DispatchData allocates (on Linux), on macOS it seems to be fine without.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at DispatchDataIterator in src/swift/Data.swift around line 325, then read the __DispatchData definition in src/swift/Wrapper.swift around line 190. Investigate why iterator creation allocates on Linux and compare the macOS behavior; done means iterating DispatchData no longer incurs that allocation without changing its behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100