D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6040 - std.cpuid and core.cpuid return different values for some methods
Summary: std.cpuid and core.cpuid return different values for some methods
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-05-20 10:29 UTC by kai
Modified: 2011-09-07 22:30 UTC (History)
3 users (show)

See Also:


Attachments
Implement std.cpuid in terms of core.cpuid (10.37 KB, patch)
2011-05-20 10:29 UTC, kai
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description kai 2011-05-20 10:29:14 UTC
Created attachment 987 [details]
Implement std.cpuid in terms of core.cpuid

std.cpuid (from Phobos) duplicates functionality from core.cpuid (from
druntime). Worse, some methods return different values. E.g. hyperThreading()
and threadsPerCPU(). 
(BTW: std.cpuid.threadsPerCPU() returns 16 for my i7, which is totally wrong.)

The attached patch removes the implementation from std.cpuid and uses alias to
reuse core.cpuid while preserving API compatibility.
Comment 1 Don 2011-05-20 14:48:52 UTC
std.cpuid should just be removed.
Comment 2 Walter Bright 2011-09-07 22:30:08 UTC
Fixed 2.055