diff options
author | 2016-03-21 17:16:01 -0700 | |
---|---|---|
committer | 2016-03-21 17:16:01 -0700 | |
commit | 04961a09220bdfb5665d8017af0a698af9f4c422 (patch) | |
tree | 2a74afdc1658e35cd3d92435a8797b43587bf590 /test | |
parent | c5a4cef66b4e7d803e47809eae8a1e2db94f04f8 (diff) | |
parent | ca2886a05c85d634d324de6a5e359f34664d76b8 (diff) |
Merge pull request #5863 from dgquintas/includes_namespaces
Ensure that no #includes are inside of a namespace.
Diffstat (limited to 'test')
-rw-r--r-- | test/cpp/qps/limit_cores.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/test/cpp/qps/limit_cores.cc b/test/cpp/qps/limit_cores.cc index fad9a323af..59ed369067 100644 --- a/test/cpp/qps/limit_cores.cc +++ b/test/cpp/qps/limit_cores.cc @@ -37,14 +37,15 @@ #include <grpc/support/log.h> #include <grpc/support/port_platform.h> -namespace grpc { -namespace testing { - #ifdef GPR_CPU_LINUX #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include <sched.h> + +namespace grpc { +namespace testing { + int LimitCores(const int* cores, int cores_size) { const int num_cores = gpr_cpu_num_cores(); int cores_set = 0; @@ -71,9 +72,16 @@ int LimitCores(const int* cores, int cores_size) { CPU_FREE(cpup); return cores_set; } + +} // namespace testing +} // namespace grpc #else +namespace grpc { +namespace testing { + // LimitCores is not currently supported for non-Linux platforms int LimitCores(const int*, int) { return gpr_cpu_num_cores(); } -#endif + } // namespace testing } // namespace grpc +#endif |