Skip to content
Snippets Groups Projects
Commit c7f05e08 authored by Gennadiy Rozental's avatar Gennadiy Rozental
Browse files

Merge pull request #2872 from elindsey:master

PiperOrigin-RevId: 320224740
parents 592d4642 a2533417
No related branches found
No related tags found
No related merge requests found
......@@ -198,7 +198,8 @@ size_t GetThreadCount() {
if (sysctl(mib, miblen, NULL, &size, NULL, 0)) {
return 0;
}
mib[5] = size / mib[4];
mib[5] = static_cast<int>(size / static_cast<size_t>(mib[4]));
// populate array of structs
struct kinfo_proc info[mib[5]];
......@@ -207,8 +208,8 @@ size_t GetThreadCount() {
}
// exclude empty members
int nthreads = 0;
for (size_t i = 0; i < size / mib[4]; i++) {
size_t nthreads = 0;
for (size_t i = 0; i < size / static_cast<size_t>(mib[4]); i++) {
if (info[i].p_tid != -1)
nthreads++;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment