summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c')
-rw-r--r--src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c b/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c
deleted file mode 100644
index 5d9e3774e7..0000000000
--- a/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c
+++ /dev/null
@@ -1,46 +0,0 @@
1/* $OpenBSD: malloc_ulimit2.c,v 1.5 2019/06/12 11:31:36 bluhm Exp $ */
2
3/* Public Domain, 2006, Otto Moerbeek <otto@drijf.net> */
4
5#include <sys/types.h>
6#include <sys/time.h>
7#include <sys/resource.h>
8#include <err.h>
9#include <stdlib.h>
10#include <stdio.h>
11
12#define FACTOR 1024
13
14/* This test takes forever with junking turned on. */
15char *malloc_options = "jj";
16
17int
18main()
19{
20 struct rlimit lim;
21 size_t sz;
22 int i;
23 void *p;
24
25 if (getrlimit(RLIMIT_DATA, &lim) == -1)
26 err(1, "getrlimit");
27
28 sz = lim.rlim_cur / FACTOR;
29
30 for (i = 0; ; i++) {
31 size_t len = (sz-i) * FACTOR;
32 p = malloc(len);
33 if (p != NULL) {
34 free(p);
35 break;
36 }
37 }
38 i += 10;
39 for (; i >= 0; i--) {
40 size_t len = (sz-i) * FACTOR;
41 p = malloc(len);
42 free(p);
43 free(malloc(4096));
44 }
45 return (0);
46}