diff options
| author | cvs2svn <admin@example.com> | 2025-08-02 06:16:35 +0000 |
|---|---|---|
| committer | cvs2svn <admin@example.com> | 2025-08-02 06:16:35 +0000 |
| commit | a397c95f8aea58533e72379d6e0de12683ecd0dc (patch) | |
| tree | 45ccaccd0ce2ea01650f0a9f5e9268a656e17e51 /src/regress/lib/libc/malloc/malloc_ulimit2 | |
| parent | a79e90e7342954ae2287db505811ca3c1cd336d7 (diff) | |
| download | openbsd-tb_20250802.tar.gz openbsd-tb_20250802.tar.bz2 openbsd-tb_20250802.zip | |
This commit was manufactured by cvs2git to create tag 'tb_20250802'.tb_20250802
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 | 46 |
2 files changed, 0 insertions, 51 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 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. */ | ||
| 15 | char *malloc_options = "jj"; | ||
| 16 | |||
| 17 | int | ||
| 18 | main() | ||
| 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 | } | ||
