Fix memory leaks. Add debug message when microarch is unknown

This commit is contained in:
Dr-Noob
2020-09-01 11:32:08 +02:00
parent de8952b4ea
commit 5cca6df218
7 changed files with 27 additions and 14 deletions

View File

@@ -909,10 +909,12 @@ char* get_str_freq(struct frequency* freq) {
return string;
}
void print_levels(struct cpuInfo* cpu, char* cpu_name) {
printf("%s\n", cpu_name);
void print_levels(struct cpuInfo* cpu) {
printf("%s\n", cpu->cpu_name);
printf("- Max standart level: 0x%.8X\n", cpu->maxLevels);
printf("- Max extended level: 0x%.8X\n", cpu->maxExtendedLevels);
free_cpuinfo_struct(cpu);
}
void free_topo_struct(struct topology* topo) {
@@ -931,3 +933,9 @@ void free_cache_struct(struct cache* cach) {
void free_freq_struct(struct frequency* freq) {
free(freq);
}
void free_cpuinfo_struct(struct cpuInfo* cpu) {
free_uarch_struct(cpu->arch);
free(cpu->cpu_name);
free(cpu);
}