diff options
Diffstat (limited to 'src/regress/lib/libc/malloc')
3 files changed, 18 insertions, 11 deletions
diff --git a/src/regress/lib/libc/malloc/malloc_errs/malloc_errs.c b/src/regress/lib/libc/malloc/malloc_errs/malloc_errs.c index 486c247f0d..57d799f49d 100644 --- a/src/regress/lib/libc/malloc/malloc_errs/malloc_errs.c +++ b/src/regress/lib/libc/malloc/malloc_errs/malloc_errs.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: malloc_errs.c,v 1.5 2024/04/14 17:47:41 otto Exp $ */ | 1 | /* $OpenBSD: malloc_errs.c,v 1.6 2025/05/24 06:40:29 otto Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2023 Otto Moerbeek <otto@drijf.net> | 3 | * Copyright (c) 2023 Otto Moerbeek <otto@drijf.net> |
| 4 | * | 4 | * |
| @@ -286,11 +286,10 @@ int main(int argc, char *argv[]) | |||
| 286 | int i, status; | 286 | int i, status; |
| 287 | pid_t pid; | 287 | pid_t pid; |
| 288 | char num[10]; | 288 | char num[10]; |
| 289 | char options[10]; | 289 | char options[40]; |
| 290 | extern char* malloc_options; | 290 | char const *env[2]; |
| 291 | 291 | ||
| 292 | if (argc == 3) { | 292 | if (argc == 2) { |
| 293 | malloc_options = argv[2]; | ||
| 294 | /* prevent coredumps */ | 293 | /* prevent coredumps */ |
| 295 | setrlimit(RLIMIT_CORE, &lim); | 294 | setrlimit(RLIMIT_CORE, &lim); |
| 296 | i = atoi(argv[1]); | 295 | i = atoi(argv[1]); |
| @@ -303,9 +302,11 @@ int main(int argc, char *argv[]) | |||
| 303 | pid = fork(); | 302 | pid = fork(); |
| 304 | switch (pid) { | 303 | switch (pid) { |
| 305 | case 0: | 304 | case 0: |
| 306 | snprintf(options, sizeof(options), "us%s", tests[i].flags); | 305 | snprintf(options, sizeof(options), "MALLOC_OPTIONS=us%s", tests[i].flags); |
| 307 | snprintf(num, sizeof(num), "%d", i); | 306 | snprintf(num, sizeof(num), "%d", i); |
| 308 | execl(argv[0], argv[0], num, options, NULL); | 307 | env[0] = options; |
| 308 | env[1] = NULL; | ||
| 309 | execle(argv[0], argv[0], num, NULL, env); | ||
| 309 | err(1, "exec"); | 310 | err(1, "exec"); |
| 310 | break; | 311 | break; |
| 311 | case -1: | 312 | case -1: |
diff --git a/src/regress/lib/libc/malloc/malloc_general/malloc_general.c b/src/regress/lib/libc/malloc/malloc_general/malloc_general.c index b243787bcf..b0387ce64e 100644 --- a/src/regress/lib/libc/malloc/malloc_general/malloc_general.c +++ b/src/regress/lib/libc/malloc/malloc_general/malloc_general.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: malloc_general.c,v 1.7 2022/01/09 07:18:50 otto Exp $ */ | 1 | /* $OpenBSD: malloc_general.c,v 1.8 2025/10/26 21:25:12 miod Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2017 Otto Moerbeek <otto@drijf.net> | 3 | * Copyright (c) 2017 Otto Moerbeek <otto@drijf.net> |
| 4 | * | 4 | * |
| @@ -24,6 +24,12 @@ | |||
| 24 | 24 | ||
| 25 | #define N 1000 | 25 | #define N 1000 |
| 26 | 26 | ||
| 27 | #if defined(_LP64) | ||
| 28 | #define COUNT 800000 | ||
| 29 | #else | ||
| 30 | #define COUNT 20000 | ||
| 31 | #endif | ||
| 32 | |||
| 27 | size_t | 33 | size_t |
| 28 | size(void) | 34 | size(void) |
| 29 | { | 35 | { |
| @@ -59,7 +65,7 @@ main(int argc, char *argv[]) | |||
| 59 | void * q; | 65 | void * q; |
| 60 | size_t sz; | 66 | size_t sz; |
| 61 | 67 | ||
| 62 | for (count = 0; count < 800000; count++) { | 68 | for (count = 0; count < COUNT; count++) { |
| 63 | if (count % 10000 == 0) { | 69 | if (count % 10000 == 0) { |
| 64 | printf("."); | 70 | printf("."); |
| 65 | fflush(stdout); | 71 | fflush(stdout); |
diff --git a/src/regress/lib/libc/malloc/malloc_ulimit1/malloc_ulimit1.c b/src/regress/lib/libc/malloc/malloc_ulimit1/malloc_ulimit1.c index 799d2b9117..7e53c32dbc 100644 --- a/src/regress/lib/libc/malloc/malloc_ulimit1/malloc_ulimit1.c +++ b/src/regress/lib/libc/malloc/malloc_ulimit1/malloc_ulimit1.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: malloc_ulimit1.c,v 1.5 2019/06/12 11:31:36 bluhm Exp $ */ | 1 | /* $OpenBSD: malloc_ulimit1.c,v 1.6 2025/05/24 06:47:27 otto Exp $ */ |
| 2 | 2 | ||
| 3 | /* Public Domain, 2006, Otto Moerbeek <otto@drijf.net> */ | 3 | /* Public Domain, 2006, Otto Moerbeek <otto@drijf.net> */ |
| 4 | 4 | ||
| @@ -23,7 +23,7 @@ | |||
| 23 | #define FACTOR 1024 | 23 | #define FACTOR 1024 |
| 24 | 24 | ||
| 25 | /* This test takes forever with junking turned on. */ | 25 | /* This test takes forever with junking turned on. */ |
| 26 | char *malloc_options = "jj"; | 26 | const char * const malloc_options = "jj"; |
| 27 | 27 | ||
| 28 | int | 28 | int |
| 29 | main() | 29 | main() |
