Forgot to put this in the Mac version

pull/5039/head
vjpai 9 years ago
parent ac1ac3ab3d
commit 574020edf1
  1. 6
      test/cpp/qps/limit_cores.cc

@ -46,11 +46,11 @@ namespace testing {
#define _GNU_SOURCE #define _GNU_SOURCE
#endif #endif
#include <sched.h> #include <sched.h>
int LimitCores(const int *cores, int cores_size) { int LimitCores(const int* cores, int cores_size) {
const int num_cores = gpr_cpu_num_cores(); const int num_cores = gpr_cpu_num_cores();
int cores_set = 0; int cores_set = 0;
cpu_set_t *cpup = CPU_ALLOC(num_cores); cpu_set_t* cpup = CPU_ALLOC(num_cores);
GPR_ASSERT(cpup); GPR_ASSERT(cpup);
const size_t size = CPU_ALLOC_SIZE(num_cores); const size_t size = CPU_ALLOC_SIZE(num_cores);
CPU_ZERO_S(size, cpup); CPU_ZERO_S(size, cpup);
@ -74,7 +74,7 @@ int LimitCores(const int *cores, int cores_size) {
} }
#else #else
// LimitCores is not currently supported for non-Linux platforms // LimitCores is not currently supported for non-Linux platforms
int LimitCores(std::vector<int> core_vec) { return gpr_cpu_num_cores(); } int LimitCores(const int*, int) { return gpr_cpu_num_cores(); }
#endif #endif
} // namespace testing } // namespace testing
} // namespace grpc } // namespace grpc

Loading…
Cancel
Save