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-11741] Fix "dangling pointer" warning in benchmark suite #54148
Comments
@gottesmm Who owns the benchmark suite? |
I wouldn't say that anyone owns it specifically. If this is fixing a real issue, feel free to change. We always fix bugs. Put up a PR and lets see if the fix changes performance? FYI: @atrick@eeckstein |
Oh, I see this is just in the driver. Please put up a PR. I can review this. The change will for sure be tested by a full test. |
Comment by Jacob Mao (JIRA) Hi: I am going to change the code to: let p = UnsafeMutablePointer(withUnsafeMutablePointer(to: &u) { return $0 }) |
jacobmao0416 (JIRA User) Sure thing, feel free to assign yourself! Note though that the pointer provided by withUnsafeMutablePointer(to: &u) { p in
p.withMemoryRebound(to: Optional<rusage_info_t>.self, capacity: 1) { up in
let _ = proc_pid_rusage(getpid(), RUSAGE_INFO_V4, up)
}
} Though while we're here we should also avoid using |
Comment by Jacob Mao (JIRA) @hamishknight, thanks I have created pr for this: |
Fixed in the above linked PR, thanks jacobmao0416 (JIRA User)! |
Environment
Swift version 5.1.1-dev (Swift a90450e8c1)
Target: x86_64-apple-darwin19.0.0
Additional Detail from JIRA
md5: 298dbcfb2f25566234230bd6b2cde0fe
Issue Description:
Currently compiling the benchmark suite emits the following warning:
We should fix this such that we don't escape the inout-to-pointer conversion.
The text was updated successfully, but these errors were encountered: