diff options
author | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2018-01-01 18:19:06 +0000 |
---|---|---|
committer | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2018-01-01 18:19:06 +0000 |
commit | c41d3f086b0c267efb242b5fb0b6ad42ba442720 (patch) | |
tree | 83b578265c8a9eefccc0633ea56264a0788b5480 | |
parent | 803a9a0208b46cff21135c1a81b53b2b6cc54ea6 (diff) |
[scudo] Touch memory to count as RSS
This should fix the test from https://reviews.llvm.org/D41128.
Differential Revision: https://reviews.llvm.org/D41649
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321627 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/scudo/interface.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/scudo/interface.cpp b/test/scudo/interface.cpp index 73ea0a738..ec7375193 100644 --- a/test/scudo/interface.cpp +++ b/test/scudo/interface.cpp @@ -4,7 +4,6 @@ // RUN: %run %t heap-size 2>&1 // RUN: %env_scudo_opts="allocator_may_return_null=1" %run %t soft-limit 2>&1 // RUN: %env_scudo_opts="allocator_may_return_null=1" not %run %t hard-limit 2>&1 -// UNSUPPORTED: armhf-linux // Tests that the sanitizer interface functions behave appropriately. @@ -51,8 +50,11 @@ int main(int argc, char **argv) // Verifies that setting the soft RSS limit at runtime works as expected. std::vector<void *> pointers; size_t size = 1 << 19; // 512Kb - for (int i = 0; i < 5; i++) - pointers.push_back(malloc(size)); + for (int i = 0; i < 5; i++) { + void *p = malloc(size); + memset(p, 0, size); + pointers.push_back(p); + } // Set the soft RSS limit to 1Mb. __scudo_set_rss_limit(1, 0); usleep(20000); @@ -74,8 +76,11 @@ int main(int argc, char **argv) // Verifies that setting the hard RSS limit at runtime works as expected. std::vector<void *> pointers; size_t size = 1 << 19; // 512Kb - for (int i = 0; i < 5; i++) - pointers.push_back(malloc(size)); + for (int i = 0; i < 5; i++) { + void *p = malloc(size); + memset(p, 0, size); + pointers.push_back(p); + } // Set the hard RSS limit to 1Mb __scudo_set_rss_limit(1, 1); usleep(20000); |