From a7679dc971b8f1174ee0d308aa3590787634a343 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 15 Feb 2014 01:41:49 +0100 Subject: [PATCH] change vmfill into memfill that limits heap separately (needed on arm) --- src/common/test.h | 1 + src/regression/malloc-oom.c | 4 ++-- src/regression/pthread_create-oom.c | 7 ++----- src/regression/setenv-oom.c | 5 +++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/common/test.h b/src/common/test.h index 21e5caf..418eae1 100644 --- a/src/common/test.h +++ b/src/common/test.h @@ -11,6 +11,7 @@ extern volatile int t_status; int t_printf(const char *s, ...); int t_vmfill(void **, size_t *, int); +int t_memfill(void); void t_fdfill(void); diff --git a/src/regression/malloc-oom.c b/src/regression/malloc-oom.c index 4e40ccd..d9a1f6e 100644 --- a/src/regression/malloc-oom.c +++ b/src/regression/malloc-oom.c @@ -6,8 +6,8 @@ int main(void) { - if (t_vmfill(0,0,0) < 0) - t_error("vmfill failed: %s\n", strerror(errno)); + if (t_memfill() < 0) + t_error("memfill failed\n"); errno = 0; if (malloc(50000)) diff --git a/src/regression/pthread_create-oom.c b/src/regression/pthread_create-oom.c index e8d8169..c52a914 100644 --- a/src/regression/pthread_create-oom.c +++ b/src/regression/pthread_create-oom.c @@ -15,11 +15,8 @@ int main(void) pthread_t td; int r, arg; - r = t_vmfill(0, 0, 0); - if (r <= 0) { - t_error("fatal: vmfill has failed\n"); - return 1; - } + if (t_memfill() < 0) + t_error("memfill failed\n"); r = pthread_create(&td, 0, start, &arg); if (r == 0) t_error("pthread_create succeeded\n"); diff --git a/src/regression/setenv-oom.c b/src/regression/setenv-oom.c index d7e6162..6780310 100644 --- a/src/regression/setenv-oom.c +++ b/src/regression/setenv-oom.c @@ -1,6 +1,7 @@ // commit 543787039098c121917cb5f3e129d84b61afa61b 2013-10-04 // setenv should not crash on oom #include +#include #include #include #include "test.h" @@ -9,8 +10,8 @@ int main(void) { char buf[10000]; - if (t_vmfill(0,0,0) < 0) - t_error("vmfill failed: %s\n", strerror(errno)); + if (t_memfill() < 0) + t_error("memfill failed\n"); memset(buf, 'x', sizeof buf); buf[sizeof buf - 1] = 0; -- 2.20.1