diff options
author | Elliott Hughes <enh@google.com> | 2017-10-03 21:56:15 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-10-03 21:56:15 +0000 |
commit | 48fbf91672d096bdec664374d16d65488b77251c (patch) | |
tree | 250e5ff69984395749478f1bfa230cce90f95355 /tests/pthread_test.cpp | |
parent | c6021960a4cfe13d5dccdf54daf5a8db343e93d1 (diff) | |
parent | 575129886c2db6c7ae1dfd2655d2053166049ad1 (diff) |
Merge "Pre-size the vector in the pthread_create ENOMEM test."
Diffstat (limited to 'tests/pthread_test.cpp')
-rwxr-xr-x | tests/pthread_test.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp index 46140bbc6..f342577a9 100755 --- a/tests/pthread_test.cpp +++ b/tests/pthread_test.cpp @@ -2117,8 +2117,9 @@ TEST(pthread, pthread_create__mmap_failures) { const auto kPageSize = sysconf(_SC_PAGE_SIZE); - // Use up all the VMAs. By default this is 64Ki. + // Use up all the VMAs. By default this is 64Ki (though some will already be in use). std::vector<void*> pages; + pages.reserve(64 * 1024); int prot = PROT_NONE; while (true) { void* page = mmap(nullptr, kPageSize, prot, MAP_ANON|MAP_PRIVATE, -1, 0); |