From a5593cbfdf09c39fb89451e83f00de99d806660f Mon Sep 17 00:00:00 2001 From: guenther <> Date: Sat, 15 Oct 2016 18:24:40 +0000 Subject: Wrap _malloc_init() so internal calls go directly prodded by otto@ ok kettenis@ otto@ --- src/lib/libc/include/thread_private.h | 5 ++++- src/lib/libc/stdlib/malloc.c | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib') 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 @@ -/* $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 */ @@ -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/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 @@ -/* $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 * Copyright (c) 2012 Matthew Dempsky @@ -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) -- cgit v1.2.3-55-g6feb