diff options
| author | cvs2svn <admin@example.com> | 2018-11-07 01:08:50 +0000 |
|---|---|---|
| committer | cvs2svn <admin@example.com> | 2018-11-07 01:08:50 +0000 |
| commit | 2035faf3f8aa95b888d9416c3cc7328c0ea18beb (patch) | |
| tree | f08a08d357c5d30455c569890f747c1d9b241316 /src/regress/lib/libc/malloc/malloc_ulimit2 | |
| parent | be03b61c1b8f59ccdd34dbe5f6c6b30de697d28b (diff) | |
| download | openbsd-bluhm_20181106.tar.gz openbsd-bluhm_20181106.tar.bz2 openbsd-bluhm_20181106.zip | |
This commit was manufactured by cvs2git to create tag 'bluhm_20181106'.bluhm_20181106
Diffstat (limited to 'src/regress/lib/libc/malloc/malloc_ulimit2')
| -rw-r--r-- | src/regress/lib/libc/malloc/malloc_ulimit2/Makefile | 5 | ||||
| -rw-r--r-- | src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c | 43 |
2 files changed, 0 insertions, 48 deletions
diff --git a/src/regress/lib/libc/malloc/malloc_ulimit2/Makefile b/src/regress/lib/libc/malloc/malloc_ulimit2/Makefile deleted file mode 100644 index bc83666415..0000000000 --- a/src/regress/lib/libc/malloc/malloc_ulimit2/Makefile +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.1 2006/04/18 19:04:03 otto Exp $ | ||
| 2 | |||
| 3 | PROG= malloc_ulimit2 | ||
| 4 | |||
| 5 | .include <bsd.regress.mk> | ||
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 9510649090..0000000000 --- a/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | /* $OpenBSD: malloc_ulimit2.c,v 1.3 2017/07/27 15:08:37 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 | int | ||
| 15 | main() | ||
| 16 | { | ||
| 17 | struct rlimit lim; | ||
| 18 | size_t sz; | ||
| 19 | int i; | ||
| 20 | void *p; | ||
| 21 | |||
| 22 | if (getrlimit(RLIMIT_DATA, &lim) == -1) | ||
| 23 | err(1, "getrlimit"); | ||
| 24 | |||
| 25 | sz = lim.rlim_cur / FACTOR; | ||
| 26 | |||
| 27 | for (i = 0; ; i++) { | ||
| 28 | size_t len = (sz-i) * FACTOR; | ||
| 29 | p = malloc(len); | ||
| 30 | if (p != NULL) { | ||
| 31 | free(p); | ||
| 32 | break; | ||
| 33 | } | ||
| 34 | } | ||
| 35 | i += 10; | ||
| 36 | for (; i >= 0; i--) { | ||
| 37 | size_t len = (sz-i) * FACTOR; | ||
| 38 | p = malloc(len); | ||
| 39 | free(p); | ||
| 40 | free(malloc(4096)); | ||
| 41 | } | ||
| 42 | return (0); | ||
| 43 | } | ||
