swiftlang / swiftlang/swift-corelibs-libdispatch

[SR-7544] DispatchData.makeIterator allocates

Open
#656 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug libdispatch
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:

--> iterating a DispatchData allocates (on Linux), on macOS it seems to be fine without.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.