change vmfill into memfill that limits heap separately (needed on arm)
authorSzabolcs Nagy <nsz@port70.net>
Sat, 15 Feb 2014 00:41:49 +0000 (01:41 +0100)
committerSzabolcs Nagy <nsz@port70.net>
Sat, 15 Feb 2014 00:41:49 +0000 (01:41 +0100)
src/common/test.h
src/regression/malloc-oom.c
src/regression/pthread_create-oom.c
src/regression/setenv-oom.c

index 21e5caf..418eae1 100644 (file)
@@ -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);
 
index 4e40ccd..d9a1f6e 100644 (file)
@@ -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))
index e8d8169..c52a914 100644 (file)
@@ -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");
index d7e6162..6780310 100644 (file)
@@ -1,6 +1,7 @@
 // commit 543787039098c121917cb5f3e129d84b61afa61b 2013-10-04
 // setenv should not crash on oom
 #include <stdlib.h>
+#include <sys/resource.h>
 #include <string.h>
 #include <errno.h>
 #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;