Skip to content

Commit

Permalink
ARROW-7927: [C++] Fix 'cpu_info.cc' compilation warning.
Browse files Browse the repository at this point in the history
On some aarch64 platform, '_SC_LEVEL1_DCACHE_SIZE' would be defined
but sysconf(_SC_LEVEL1_DCACHE_SIZE) doesn't work, always return 0;

Closes #6610 from guyuqi/ARROW-7927

Authored-by: Yuqi Gu <yuqi.gu@arm.com>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
  • Loading branch information
guyuqi authored and bkietz committed Mar 19, 2020
1 parent 6fe8c18 commit 70b0921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/arrow/util/cpu_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ int CpuInfo::num_cores() { return num_cores_; }
std::string CpuInfo::model_name() { return model_name_; }

void CpuInfo::SetDefaultCacheSize() {
#ifdef _SC_LEVEL1_DCACHE_SIZE
#if defined(_SC_LEVEL1_DCACHE_SIZE) && !defined(__aarch64__)
// Call sysconf to query for the cache sizes
cache_sizes_[0] = sysconf(_SC_LEVEL1_DCACHE_SIZE);
cache_sizes_[1] = sysconf(_SC_LEVEL2_CACHE_SIZE);
Expand Down

0 comments on commit 70b0921

Please sign in to comment.