diff options
author | Robert Wu <85952307+robertwu1@users.noreply.github.com> | 2023-08-15 13:10:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-15 13:10:57 -0700 |
commit | a2a5e63047ed80befabf2e8fc0b3d06e300ae4ef (patch) | |
tree | f3ecc32cd92e67237b5ebf500339cd2a3639df58 | |
parent | ed87db6c78a875acf7f1723422ad0d6f1963c90a (diff) | |
download | oboe-a2a5e63047ed80befabf2e8fc0b3d06e300ae4ef.tar.gz |
OboeTester: Stop using get_nprocs() (#1899)
-rw-r--r-- | apps/OboeTester/app/src/main/cpp/OboeStreamCallbackProxy.h | 2 | ||||
-rw-r--r-- | apps/OboeTester/app/src/main/cpp/jni-bridge.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/OboeTester/app/src/main/cpp/OboeStreamCallbackProxy.h b/apps/OboeTester/app/src/main/cpp/OboeStreamCallbackProxy.h index bd8725d9..6834647d 100644 --- a/apps/OboeTester/app/src/main/cpp/OboeStreamCallbackProxy.h +++ b/apps/OboeTester/app/src/main/cpp/OboeStreamCallbackProxy.h @@ -223,7 +223,7 @@ public: int applyCpuAffinityMask(uint32_t mask) { cpu_set_t cpu_set; CPU_ZERO(&cpu_set); - int cpuCount = get_nprocs(); + int cpuCount = sysconf(_SC_NPROCESSORS_CONF); for (int cpuIndex = 0; cpuIndex < cpuCount; cpuIndex++) { if (mask & (1 << cpuIndex)) { CPU_SET(cpuIndex, &cpu_set); diff --git a/apps/OboeTester/app/src/main/cpp/jni-bridge.cpp b/apps/OboeTester/app/src/main/cpp/jni-bridge.cpp index 73b0f843..2907f947 100644 --- a/apps/OboeTester/app/src/main/cpp/jni-bridge.cpp +++ b/apps/OboeTester/app/src/main/cpp/jni-bridge.cpp @@ -118,7 +118,7 @@ Java_com_mobileer_oboetester_NativeEngine_areWorkaroundsEnabled(JNIEnv *env, JNIEXPORT jint JNICALL Java_com_mobileer_oboetester_NativeEngine_getCpuCount(JNIEnv *env, jclass type) { - return get_nprocs(); + return sysconf(_SC_NPROCESSORS_CONF); } JNIEXPORT void JNICALL |