From ef3968f55143672b295cb6559f88e9db1bf446c1 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 8 May 2019 21:20:49 -0400 Subject: [PATCH] Guard x86 cache line size --- cpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu.cpp b/cpu.cpp index 0343f4ec..34449d38 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -464,7 +464,7 @@ void DetectX86Features() // Glibc does not implement on some platforms. The runtime returns 0 instead of error. // https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/posix/sysconf.c int cacheLineSize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); - if (cacheLineSize > 0) + if (g_cacheLineSize == 0 && cacheLineSize > 0) g_cacheLineSize = cacheLineSize; #endif