summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorguenther <>2016-10-15 18:24:40 +0000
committerguenther <>2016-10-15 18:24:40 +0000
commita5593cbfdf09c39fb89451e83f00de99d806660f (patch)
tree55d463b414dc2b1c436f8857074759dd31f5a017 /src
parentfd9bf17b83993290e35c8d524c712af4003fa6ba (diff)
downloadopenbsd-a5593cbfdf09c39fb89451e83f00de99d806660f.tar.gz
openbsd-a5593cbfdf09c39fb89451e83f00de99d806660f.tar.bz2
openbsd-a5593cbfdf09c39fb89451e83f00de99d806660f.zip
Wrap _malloc_init() so internal calls go directly
prodded by otto@ ok kettenis@ otto@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/include/thread_private.h5
-rw-r--r--src/lib/libc/stdlib/malloc.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libc/include/thread_private.h b/src/lib/libc/include/thread_private.h
index 81caaaae68..b443e32e83 100644
--- a/src/lib/libc/include/thread_private.h
+++ b/src/lib/libc/include/thread_private.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: thread_private.h,v 1.28 2016/09/01 10:41:02 otto Exp $ */ 1/* $OpenBSD: thread_private.h,v 1.29 2016/10/15 18:24:40 guenther Exp $ */
2 2
3/* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */ 3/* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */
4 4
@@ -9,6 +9,9 @@
9 9
10#define _MALLOC_MUTEXES 4 10#define _MALLOC_MUTEXES 4
11void _malloc_init(int); 11void _malloc_init(int);
12#ifdef __LIBC__
13PROTO_NORMAL(_malloc_init);
14#endif /* __LIBC__ */
12 15
13/* 16/*
14 * The callbacks needed by libc to handle the threaded case. 17 * The callbacks needed by libc to handle the threaded case.
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c
index dc32420ffc..7e7364f484 100644
--- a/src/lib/libc/stdlib/malloc.c
+++ b/src/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: malloc.c,v 1.201 2016/10/14 17:33:36 otto Exp $ */ 1/* $OpenBSD: malloc.c,v 1.202 2016/10/15 18:24:40 guenther Exp $ */
2/* 2/*
3 * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net> 3 * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net>
4 * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> 4 * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@@ -1249,6 +1249,7 @@ _malloc_init(int from_rthreads)
1249 mprotect(&malloc_readonly, sizeof(malloc_readonly), PROT_READ); 1249 mprotect(&malloc_readonly, sizeof(malloc_readonly), PROT_READ);
1250 _MALLOC_UNLOCK(0); 1250 _MALLOC_UNLOCK(0);
1251} 1251}
1252DEF_STRONG(_malloc_init);
1252 1253
1253void * 1254void *
1254malloc(size_t size) 1255malloc(size_t size)