From 3668a2e4940ebe0e7c33729ad375a9a7b0c6ceb1 Mon Sep 17 00:00:00 2001 From: jasone Date: Thu, 12 Jan 2006 07:28:21 +0000 Subject: In preparation for a new malloc implementation: * Add posix_memalign(). * Move calloc() from calloc.c to malloc.c. Add a calloc() implementation in rtld-elf in order to make the loader happy (even though calloc() isn't used in rtld-elf). * Add _malloc_prefork() and _malloc_postfork(), and use them instead of directly manipulating __malloc_lock. Approved by: phk, markm (mentor) --- lib/libc/include/libc_private.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/libc/include/libc_private.h') diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 8dca7a0..0959c6c 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -130,10 +130,11 @@ void _set_tp(void *tp); extern const char *__progname; /* - * This is the lock to make malloc() thread-safe. It is externalized - * so that thread libraries can protect malloc across fork(). + * These functions are used by the threading libraries in order to protect + * malloc across fork(). */ -extern struct _spinlock *__malloc_lock; +void _malloc_prefork(void); +void _malloc_postfork(void); /* * Function to clean up streams, called from abort() and exit(). -- cgit v1.1