mirror of
https://github.com/google/googletest.git
synced 2024-12-26 17:41:03 +08:00
This trips up when compiling with -Wvla otherwise.
PiperOrigin-RevId: 529762901 Change-Id: I6ce4d630191bf265f847aef2d5dcc12a712faa60
This commit is contained in:
parent
a3580180d1
commit
bc860af087
@ -199,8 +199,8 @@ size_t GetThreadCount() {
|
|||||||
mib[5] = static_cast<int>(size / static_cast<size_t>(mib[4]));
|
mib[5] = static_cast<int>(size / static_cast<size_t>(mib[4]));
|
||||||
|
|
||||||
// populate array of structs
|
// populate array of structs
|
||||||
struct kinfo_proc info[mib[5]];
|
std::vector<struct kinfo_proc> info(mib[5]);
|
||||||
if (sysctl(mib, miblen, &info, &size, NULL, 0)) {
|
if (sysctl(mib, miblen, info.data(), &size, NULL, 0)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user