mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Don't ceil cpu_count()
It is already done at calling site where it is more appropiate. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
f8224fc7d3
commit
11b0c7b44a
1 changed files with 3 additions and 4 deletions
|
@ -35,7 +35,6 @@
|
||||||
# include <xmmintrin.h>
|
# include <xmmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -174,16 +173,16 @@ int cpu_count() {
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
SYSTEM_INFO s;
|
SYSTEM_INFO s;
|
||||||
GetSystemInfo(&s);
|
GetSystemInfo(&s);
|
||||||
return std::min(int(s.dwNumberOfProcessors), MAX_THREADS);
|
return s.dwNumberOfProcessors;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
# if defined(_SC_NPROCESSORS_ONLN)
|
# if defined(_SC_NPROCESSORS_ONLN)
|
||||||
return std::min((int)sysconf(_SC_NPROCESSORS_ONLN), MAX_THREADS);
|
return sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
# elif defined(__hpux)
|
# elif defined(__hpux)
|
||||||
struct pst_dynamic psd;
|
struct pst_dynamic psd;
|
||||||
if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) == -1)
|
if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) == -1)
|
||||||
return 1;
|
return 1;
|
||||||
return std::min((int)psd.psd_proc_cnt, MAX_THREADS);
|
return psd.psd_proc_cnt;
|
||||||
# else
|
# else
|
||||||
return 1;
|
return 1;
|
||||||
# endif
|
# endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue