Skip to content

Commit 6130726

Browse files
author
Requiem
committed
style: changed struct name from ::Entry to ::thread_entry
1 parent 416d484 commit 6130726

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/vmaware.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,10 +1817,10 @@ struct VM {
18171817
};
18181818

18191819
// this forces the compiler to calculate the hash when initializing the array while staying C++11 compatible
1820-
struct Entry {
1820+
struct thread_entry {
18211821
u32 hash;
18221822
u32 threads;
1823-
constexpr Entry(const char* m, u32 t) : hash(ConstexprHash::get(m)), threads(t) {}
1823+
constexpr thread_entry(const char* m, u32 t) : hash(ConstexprHash::get(m)), threads(t) {}
18241824
};
18251825

18261826
enum class CpuType {
@@ -1830,7 +1830,7 @@ struct VM {
18301830
};
18311831

18321832
// 4 arguments to stay compliant with x64 __fastcall (just in case)
1833-
[[nodiscard]] static bool verify_thread_count(const Entry* db, size_t db_size, size_t max_model_len, CpuType type) {
1833+
[[nodiscard]] static bool verify_thread_count(const thread_entry* db, size_t db_size, size_t max_model_len, CpuType type) {
18341834
// to save a few cycles
18351835
struct hasher {
18361836
static u32 crc32_sw(u32 crc, char data) {
@@ -2522,7 +2522,7 @@ struct VM {
25222522
// umap is not an option because it cannot be constexpr
25232523
// constexpr is respected here even in c++ 11 and static solves stack overflow
25242524
// c arrays have less construction overhead than std::array
2525-
static constexpr util::Entry thread_database[] = {
2525+
static constexpr util::thread_entry thread_database[] = {
25262526
// i3 series
25272527
{ "i3-1000G1", 4 },
25282528
{ "i3-1000G4", 4 },
@@ -3481,7 +3481,7 @@ struct VM {
34813481

34823482
static constexpr size_t MAX_INTEL_MODEL_LEN = 16;
34833483

3484-
return util::verify_thread_count(thread_database, sizeof(thread_database) / sizeof(util::Entry), MAX_INTEL_MODEL_LEN, util::CpuType::INTEL_I);
3484+
return util::verify_thread_count(thread_database, sizeof(thread_database) / sizeof(util::thread_entry), MAX_INTEL_MODEL_LEN, util::CpuType::INTEL_I);
34853485
#endif
34863486
}
34873487

@@ -3499,7 +3499,7 @@ struct VM {
34993499
// umap is not an option because it cannot be constexpr
35003500
// constexpr is respected here even in c++ 11 and static solves stack overflow
35013501
// c arrays have less construction overhead than std::array
3502-
static constexpr util::Entry thread_database[] = {
3502+
static constexpr util::thread_entry thread_database[] = {
35033503
// Xeon D
35043504
{ "D-1518", 8 },
35053505
{ "D-1520", 8 },
@@ -3637,7 +3637,7 @@ struct VM {
36373637

36383638
static constexpr size_t MAX_XEON_MODEL_LEN = 16;
36393639

3640-
return util::verify_thread_count(thread_database, sizeof(thread_database) / sizeof(util::Entry), MAX_XEON_MODEL_LEN, util::CpuType::INTEL_XEON);
3640+
return util::verify_thread_count(thread_database, sizeof(thread_database) / sizeof(util::thread_entry), MAX_XEON_MODEL_LEN, util::CpuType::INTEL_XEON);
36413641
#endif
36423642
}
36433643

@@ -3654,7 +3654,7 @@ struct VM {
36543654
#else
36553655
// Database is reduced to identifying suffixes (last token of the original strings)
36563656
// for example handles "ryzen 5 3600" by matching "3600", which is unique in context
3657-
static constexpr util::Entry thread_database[] = {
3657+
static constexpr util::thread_entry thread_database[] = {
36583658
// 3015/3020
36593659
{ "3015ce", 4 },
36603660
{ "3015e", 4 },
@@ -4167,7 +4167,7 @@ struct VM {
41674167

41684168
static constexpr size_t MAX_AMD_MODEL_LEN = 24; // "threadripper" is long
41694169

4170-
return util::verify_thread_count(thread_database, sizeof(thread_database) / sizeof(util::Entry), MAX_AMD_MODEL_LEN, util::CpuType::INTEL_XEON);
4170+
return util::verify_thread_count(thread_database, sizeof(thread_database) / sizeof(util::thread_entry), MAX_AMD_MODEL_LEN, util::CpuType::INTEL_XEON);
41714171
#endif
41724172
}
41734173

0 commit comments

Comments
 (0)