anrieff / libcpuid

a small C library for x86 CPU detection and feature extraction
Other
451 stars 106 forks source link

Add missing call to cpuid_set_error #202

Closed zacikpa closed 2 months ago

zacikpa commented 2 months ago

Forgotten during c5d9b38.

TheTumultuousUnicornOfDarkness commented 2 months ago

It was not forgotten: it serves a purpose in cpuid_get_all_raw_data().

cur_error = cpuid_get_raw_data_core(&raw_tmp, logical_cpu);
if (cur_error == ERR_INVCNB)
    break;

The logic is to break the loop when the affinity cannot be set, i.e. when the core number does not exist. But cpuid_get_raw_data_core() is a public function and you are right: it should be improved. I will fix it.