Make UTIL_countPhysicalCores() work under Cygwin (#1941)

Cygwin currently uses the fallback implementation which just returns 1 every time,
which leads to bad performance when zstd is called with -T0 for example.

Instead use the POSIX implementation used for the BSDs which works just fine under Cygwin.

Tested under Cygwin and MSYS2.
This commit is contained in:
Christoph Reiter 2020-01-08 00:48:26 +01:00 committed by Nick Terrell
parent 3119256267
commit d0dcaf56c2

View File

@ -903,7 +903,7 @@ int UTIL_countPhysicalCores(void)
return numPhysicalCores;
}
#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__CYGWIN__)
/* Use POSIX sysconf
* see: man 3 sysconf */