Guard x86 cache line size
parent
72a71eb230
commit
ef3968f551
2
cpu.cpp
2
cpu.cpp
|
|
@ -464,7 +464,7 @@ void DetectX86Features()
|
||||||
// Glibc does not implement on some platforms. The runtime returns 0 instead of error.
|
// 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
|
// https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/posix/sysconf.c
|
||||||
int cacheLineSize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
|
int cacheLineSize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
|
||||||
if (cacheLineSize > 0)
|
if (g_cacheLineSize == 0 && cacheLineSize > 0)
|
||||||
g_cacheLineSize = cacheLineSize;
|
g_cacheLineSize = cacheLineSize;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue