From 9f9b63f279646fe16eb9a07ade4e1fb8b665eac4 Mon Sep 17 00:00:00 2001 From: bluhm <> Date: Wed, 12 Jun 2019 11:31:36 +0000 Subject: Set malloc_options in global scope with an initializer. recommended by otto@ --- src/regress/lib/libc/malloc/malloc_ulimit1/malloc_ulimit1.c | 9 ++++----- src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src') 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 20dd1a419e..799d2b9117 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 @@ -/* $OpenBSD: malloc_ulimit1.c,v 1.4 2018/11/28 13:34:06 bluhm Exp $ */ +/* $OpenBSD: malloc_ulimit1.c,v 1.5 2019/06/12 11:31:36 bluhm Exp $ */ /* Public Domain, 2006, Otto Moerbeek */ @@ -22,6 +22,9 @@ #define STARTI 1300 #define FACTOR 1024 +/* This test takes forever with junking turned on. */ +char *malloc_options = "jj"; + int main() { @@ -29,10 +32,6 @@ main() size_t sz; int i; void *p; - extern char *malloc_options; - - /* This test takes forever with junking turned on. */ - malloc_options = "jj"; if (getrlimit(RLIMIT_DATA, &lim) == -1) err(1, "getrlimit"); diff --git a/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c b/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c index f083e31841..5d9e3774e7 100644 --- a/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c +++ b/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc_ulimit2.c,v 1.4 2018/11/29 22:23:22 bluhm Exp $ */ +/* $OpenBSD: malloc_ulimit2.c,v 1.5 2019/06/12 11:31:36 bluhm Exp $ */ /* Public Domain, 2006, Otto Moerbeek */ @@ -11,6 +11,9 @@ #define FACTOR 1024 +/* This test takes forever with junking turned on. */ +char *malloc_options = "jj"; + int main() { @@ -18,10 +21,6 @@ main() size_t sz; int i; void *p; - extern char *malloc_options; - - /* This test takes forever with junking turned on. */ - malloc_options = "jj"; if (getrlimit(RLIMIT_DATA, &lim) == -1) err(1, "getrlimit"); -- cgit v1.2.3-55-g6feb