summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorotto <>2019-06-04 05:30:39 +0000
committerotto <>2019-06-04 05:30:39 +0000
commit2e5c684b65aedf36422f17018b3515a9d5f616d7 (patch)
tree17d722230cd6d1e03a2da15eafbd5c44d67b30b5 /src
parent58bdb1d41e8c1a3d380f0ddb8bd6d28574a21514 (diff)
downloadopenbsd-2e5c684b65aedf36422f17018b3515a9d5f616d7.tar.gz
openbsd-2e5c684b65aedf36422f17018b3515a9d5f616d7.tar.bz2
openbsd-2e5c684b65aedf36422f17018b3515a9d5f616d7.zip
Move to env var, likelky the possibility to set malloc options from
main is going away.
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libc/malloc/malloc_general/Makefile16
-rw-r--r--src/regress/lib/libc/malloc/malloc_general/malloc_general.c11
2 files changed, 8 insertions, 19 deletions
diff --git a/src/regress/lib/libc/malloc/malloc_general/Makefile b/src/regress/lib/libc/malloc/malloc_general/Makefile
index a0ee823bbe..ddc3220854 100644
--- a/src/regress/lib/libc/malloc/malloc_general/Makefile
+++ b/src/regress/lib/libc/malloc/malloc_general/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.3 2017/01/24 16:03:28 otto Exp $ 1# $OpenBSD: Makefile,v 1.4 2019/06/04 05:30:39 otto Exp $
2 2
3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7
4PROG= malloc_general 4PROG= malloc_general
@@ -6,22 +6,22 @@ PROG= malloc_general
6.include <bsd.regress.mk> 6.include <bsd.regress.mk>
7 7
8t1: malloc_general 8t1: malloc_general
9 ${.OBJDIR}/malloc_general "" 9 MALLOC_OPTIONS=cfgju ${.OBJDIR}/malloc_general
10 10
11t2: malloc_general 11t2: malloc_general
12 ${.OBJDIR}//malloc_general C 12 MALLOC_OPTIONS=cfgjuC ${.OBJDIR}//malloc_general
13 13
14t3: malloc_general 14t3: malloc_general
15 ${.OBJDIR}//malloc_general J 15 MALLOC_OPTIONS=cfgjuJ ${.OBJDIR}//malloc_general
16 16
17t4: malloc_general 17t4: malloc_general
18 ${.OBJDIR}//malloc_general F 18 MALLOC_OPTIONS=cfgjuF ${.OBJDIR}//malloc_general
19 19
20t5: malloc_general 20t5: malloc_general
21 ${.OBJDIR}//malloc_general G 21 MALLOC_OPTIONS=cfgjuG ${.OBJDIR}//malloc_general
22 22
23t6: malloc_general 23t6: malloc_general
24 ${.OBJDIR}//malloc_general S 24 MALLOC_OPTIONS=cfgjuS ${.OBJDIR}//malloc_general
25 25
26t7: malloc_general 26t7: malloc_general
27 ${.OBJDIR}//malloc_general FGJ 27 MALLOC_OPTIONS=cfgjuFGJ ${.OBJDIR}//malloc_general
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 8abc5210ca..7dbaf5d8aa 100644
--- a/src/regress/lib/libc/malloc/malloc_general/malloc_general.c
+++ b/src/regress/lib/libc/malloc/malloc_general/malloc_general.c
@@ -33,8 +33,6 @@ size(void)
33 33
34struct { void *p; size_t sz; } a[N]; 34struct { void *p; size_t sz; } a[N];
35 35
36extern char *malloc_options;
37
38void 36void
39fill(u_char *p, size_t sz) 37fill(u_char *p, size_t sz)
40{ 38{
@@ -60,15 +58,6 @@ main(int argc, char *argv[])
60 int count, p, r, i; 58 int count, p, r, i;
61 void * q; 59 void * q;
62 size_t sz; 60 size_t sz;
63 char mo[20];
64
65 if (argc == 1)
66 errx(1, "usage: malloc_options");
67
68 /* first reset flags that might be set by env or sysctl */
69 strlcpy(mo, "cfgju", sizeof(mo));
70 strlcat(mo, argv[1], sizeof(mo));
71 malloc_options = mo;
72 61
73 for (count = 0; count < 800000; count++) { 62 for (count = 0; count < 800000; count++) {
74 if (count % 10000 == 0) { 63 if (count % 10000 == 0) {