-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix #2740: Use CpuInfo.Unknown if CpuDetector.Detect() does not find supported OS #2742
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
Fix #2740: Use CpuInfo.Unknown if CpuDetector.Detect() does not find supported OS #2742
Conversation
@dotnet-policy-service agree company="Lake Shore Cryotronics" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the main issue is that HostEnvironmentInfo
assigns null
to the non-nullable Cpu
. I would prefer to keep HostEnvironmentInfo.Cpu
as Lazy<CpuInfo>
(a non-nullable value) to avoid multiple null checks. CpuInfo
is already designed to potentially miss any of its properties. A better solution would be to introduce CpuInfo.Unknown
on the Perfolizer side and use it in HostEnvironmentInfo
if all the CpuDetectors
fail to detect the CPU. I will release a new version of Perfolizer and bump it in BenchmarkDotNet.
|
b473dd0
to
01b34ba
Compare
Rebased and implemented. |
The nullability of HostEnvironmentInfo's Cpu property was mistakenly going unnoticed. This caused a null reference exception in the
ZeroMeasurementAnalyser
. I corrected this by making it nullable and checking for it in the analyser. Preventing it from breaking for all not-yet supported OSCpuDetectors