Skip to content

Commit

Permalink
Fix bug in FreeBSD topology detection code
Browse files Browse the repository at this point in the history
Code incorrectly relied on undefined C behavior. Clang and gcc 4.9 do not behave
as code expected. This affected cores and processors detection on FreeBSD.
  • Loading branch information
pguyot committed Oct 19, 2014
1 parent f5b3443 commit c8ae3f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions erts/lib_src/common/erl_misc_utils.c
Expand Up @@ -1515,7 +1515,7 @@ const char* parse_topology_spec_group(erts_cpu_info_t *cpuinfo, const char* xml,
if (is_thread_group) {
thread++;
} else {
*core_p = (*core_p)++;
*core_p = (*core_p) + 1;
}
index_procs++;
}
Expand All @@ -1535,9 +1535,9 @@ const char* parse_topology_spec_group(erts_cpu_info_t *cpuinfo, const char* xml,

if (parentCacheLevel == 0) {
*core_p = 0;
*processor_p = (*processor_p)++;
*processor_p = (*processor_p) + 1;
} else {
*core_p = (*core_p)++;
*core_p = (*core_p) + 1;
}

if (error)
Expand Down

0 comments on commit c8ae3f2

Please sign in to comment.