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

Understanding scanned results #868

Open
arbyruns opened this issue Jan 17, 2025 · 0 comments
Open

Understanding scanned results #868

arbyruns opened this issue Jan 17, 2025 · 0 comments

Comments

@arbyruns
Copy link

arbyruns commented Jan 17, 2025

I'm trying to understand how periphery came to determine the following was dead code. This could also be a misunderstanding on my part, so please let me know.

scan result

0.01ms	/Volumes/macdev/fooApp/Foundations/FoundationExtensionsKit/Utilities/UnfairLock.swift:8:25	getter FoundationExtensionsKit.(file).UnfairLock._@/Volumes/macdev/fooApp/Foundations/FoundationExtensionsKit/Utilities/UnfairLock.swift:8:25

0.20ms	/Volumes/macdev/fooApp/Foundations/FoundationExtensionsKit/Utilities/UnfairLock.swift:38:26	instance method FoundationExtensionsKit.(file).UnfairLock.lock()@/Volumes/macdev/fooApp/Foundations/FoundationExtensionsKit/Utilities/UnfairLock.swift:38:26

Here's the code that was determined to not being used, but I know the lock implementation is being used within the codebase.

public final class UnfairLock: Locking {
  @usableFromInline let lockImplementation: Locking

  public init() {
    if Self.isOSAllocatedUnfairLockEnabled {
      self.lockImplementation = OSAllocatedUnfairLockWrapper()
    }
    else {
      self.lockImplementation = UnfairLockWrapper()
    }
  }

  @inlinable public func lock() {
    lockImplementation.lock()
  }
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant