aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-07-26 19:44:50 +0000
committerlloyd <[email protected]>2010-07-26 19:44:50 +0000
commitc8a27139fe6b559bca2fbb64bd180c8fd2c2fa32 (patch)
treec52cf62828a8b4a5f876d3125818202a9a22b0e0 /doc
parente51e9aa6a6033710920f0934178ef770fd25498f (diff)
Modify CPUID so all the check functions are purely inline. Add a new
initialize() call which must be called prior to use of any other functions.
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/cpuid.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/examples/cpuid.cpp b/doc/examples/cpuid.cpp
index f4d441ba2..059cfdbc0 100644
--- a/doc/examples/cpuid.cpp
+++ b/doc/examples/cpuid.cpp
@@ -14,15 +14,17 @@ namespace {
void print_if_feature(const std::string& feature_name, bool exists)
{
if(exists)
- std::cout << feature_name << '\n';
+ std::cout << "Y: " << feature_name << "\n";
else
- std::cout << '[' << feature_name << ']' << '\n';
+ std::cout << "N: " << feature_name << "\n";
}
}
int main()
{
+ CPUID::initialize();
+
std::cout << "Cache line size = " << CPUID::cache_line_size() << "\n";
print_if_feature("RDTSC", CPUID::has_rdtsc());