summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2016-10-15 18:24:40 +0000
committerguenther <guenther@openbsd.org>2016-10-15 18:24:40 +0000
commite159a97232740b51758493d29bab9f9db07bb760 (patch)
tree51218a7c05ffeb94761ba5184e2e69b1a762313f /lib/libc
parentadd kern.dnsjackport; (diff)
downloadwireguard-openbsd-e159a97232740b51758493d29bab9f9db07bb760.tar.xz
wireguard-openbsd-e159a97232740b51758493d29bab9f9db07bb760.zip
Wrap _malloc_init() so internal calls go directly
prodded by otto@ ok kettenis@ otto@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/include/thread_private.h5
-rw-r--r--lib/libc/stdlib/malloc.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/include/thread_private.h b/lib/libc/include/thread_private.h
index 81caaaae68a..b443e32e837 100644
--- a/lib/libc/include/thread_private.h
+++ b/lib/libc/include/thread_private.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: thread_private.h,v 1.28 2016/09/01 10:41:02 otto Exp $ */
+/* $OpenBSD: thread_private.h,v 1.29 2016/10/15 18:24:40 guenther Exp $ */
/* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */
@@ -9,6 +9,9 @@
#define _MALLOC_MUTEXES 4
void _malloc_init(int);
+#ifdef __LIBC__
+PROTO_NORMAL(_malloc_init);
+#endif /* __LIBC__ */
/*
* The callbacks needed by libc to handle the threaded case.
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index dc32420ffc3..7e7364f4844 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.201 2016/10/14 17:33:36 otto Exp $ */
+/* $OpenBSD: malloc.c,v 1.202 2016/10/15 18:24:40 guenther Exp $ */
/*
* Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@@ -1249,6 +1249,7 @@ _malloc_init(int from_rthreads)
mprotect(&malloc_readonly, sizeof(malloc_readonly), PROT_READ);
_MALLOC_UNLOCK(0);
}
+DEF_STRONG(_malloc_init);
void *
malloc(size_t size)