mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Make malloc build for no-threads configurations.
This commit is contained in:
@@ -141,6 +141,8 @@ int __malloc_initialized = -1;
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef NO_THREADS
|
||||
|
||||
/* atfork support. */
|
||||
|
||||
static __malloc_ptr_t (*save_malloc_hook) (size_t __size,
|
||||
@@ -276,7 +278,7 @@ ptmalloc_unlock_all (void)
|
||||
(void)mutex_unlock(&list_lock);
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
# ifdef __linux__
|
||||
|
||||
/* In NPTL, unlocking a mutex in the child process after a
|
||||
fork() is currently unsafe, whereas re-initializing it is safe and
|
||||
@@ -311,11 +313,13 @@ ptmalloc_unlock_all2 (void)
|
||||
atfork_recursive_cntr = 0;
|
||||
}
|
||||
|
||||
#else
|
||||
# else
|
||||
|
||||
#define ptmalloc_unlock_all2 ptmalloc_unlock_all
|
||||
# define ptmalloc_unlock_all2 ptmalloc_unlock_all
|
||||
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* !NO_THREADS */
|
||||
|
||||
/* Initialization routine. */
|
||||
#include <string.h>
|
||||
|
@@ -1075,9 +1075,10 @@ static void* realloc_check(void* oldmem, size_t bytes,
|
||||
const void *caller);
|
||||
static void* memalign_check(size_t alignment, size_t bytes,
|
||||
const void *caller);
|
||||
/* These routines are never needed in this configuration. */
|
||||
#ifndef NO_THREADS
|
||||
static void* malloc_atfork(size_t sz, const void *caller);
|
||||
static void free_atfork(void* mem, const void *caller);
|
||||
#endif
|
||||
|
||||
|
||||
/* ------------- Optional versions of memcopy ---------------- */
|
||||
|
Reference in New Issue
Block a user