swiftlang / swiftlang/swift-corelibs-libdispatch

[SR-2181] DispatchTimeInterval.nanoseconds won't work well on 32-bit architectures

Open
#732 6 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-2181
Radar rdar://problem/79952338
Original Reporter @lilyball
Type Bug
Environment

swift-DEVELOPMENT-SNAPSHOT-2016-07-25-a-125-g3331dc4

Additional Detail from JIRA
Votes 0
Component/s libdispatch
Labels Bug
Assignee None
Priority Medium

md5: fd6368c309cba792844d510ee431fa26

Issue Description:

DispatchTimeInterval is defined in terms of an Int. This isn't going to work well on a 32-bit architectures for nanoseconds, because it will only be able to represent just over 2 seconds worth of nanoseconds. There's a reason why the underlying APIs use UInt64 instead of a platform-defined integer.

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

The issue names no file or test. Start by locating the definition of DispatchTimeInterval and the libdispatch nanosecond APIs, then inspect how integer widths differ on 32-bit architectures. Done means nanosecond intervals beyond roughly two seconds are representable and the relevant behavior is validated on 32-bit targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, swift
Domain
operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.