forked from pool/glibc
Andreas Schwab
44414488d6
- Import patches from 2.23 branch OBS-URL: https://build.opensuse.org/request/show/394998 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=436
74 lines
2.4 KiB
Diff
74 lines
2.4 KiB
Diff
2016-02-19 Florian Weimer <fweimer@redhat.com>
|
|
|
|
* sysdeps/generic/malloc-machine.h: Assume mutex_init is always
|
|
available. Do not define NO_THREADS.
|
|
* malloc/malloc.c: Do not check NO_THREADS.
|
|
* malloc/arena.c: Likewise.
|
|
|
|
Index: glibc-2.23/malloc/arena.c
|
|
===================================================================
|
|
--- glibc-2.23.orig/malloc/arena.c
|
|
+++ glibc-2.23/malloc/arena.c
|
|
@@ -130,8 +130,6 @@ int __malloc_initialized = -1;
|
|
|
|
/**************************************************************************/
|
|
|
|
-#ifndef NO_THREADS
|
|
-
|
|
/* atfork support. */
|
|
|
|
static void *(*save_malloc_hook)(size_t __size, const void *);
|
|
@@ -330,7 +328,6 @@ ptmalloc_unlock_all2 (void)
|
|
|
|
# define ptmalloc_unlock_all2 ptmalloc_unlock_all
|
|
# endif
|
|
-#endif /* !NO_THREADS */
|
|
|
|
/* Initialization routine. */
|
|
#include <string.h>
|
|
Index: glibc-2.23/malloc/malloc.c
|
|
===================================================================
|
|
--- glibc-2.23.orig/malloc/malloc.c
|
|
+++ glibc-2.23/malloc/malloc.c
|
|
@@ -1074,10 +1074,8 @@ static void* realloc_check(void* oldme
|
|
const void *caller);
|
|
static void* memalign_check(size_t alignment, size_t bytes,
|
|
const void *caller);
|
|
-#ifndef NO_THREADS
|
|
static void* malloc_atfork(size_t sz, const void *caller);
|
|
static void free_atfork(void* mem, const void *caller);
|
|
-#endif
|
|
|
|
/* ------------------ MMAP support ------------------ */
|
|
|
|
Index: glibc-2.23/sysdeps/generic/malloc-machine.h
|
|
===================================================================
|
|
--- glibc-2.23.orig/sysdeps/generic/malloc-machine.h
|
|
+++ glibc-2.23/sysdeps/generic/malloc-machine.h
|
|
@@ -22,25 +22,6 @@
|
|
|
|
#include <atomic.h>
|
|
|
|
-#ifndef mutex_init /* No threads, provide dummy macros */
|
|
-
|
|
-# define NO_THREADS
|
|
-
|
|
-/* The mutex functions used to do absolutely nothing, i.e. lock,
|
|
- trylock and unlock would always just return 0. However, even
|
|
- without any concurrently active threads, a mutex can be used
|
|
- legitimately as an `in use' flag. To make the code that is
|
|
- protected by a mutex async-signal safe, these macros would have to
|
|
- be based on atomic test-and-set operations, for example. */
|
|
-typedef int mutex_t;
|
|
-
|
|
-# define mutex_init(m) (*(m) = 0)
|
|
-# define mutex_lock(m) ({ *(m) = 1; 0; })
|
|
-# define mutex_trylock(m) (*(m) ? 1 : ((*(m) = 1), 0))
|
|
-# define mutex_unlock(m) (*(m) = 0)
|
|
-
|
|
-#endif /* !defined mutex_init */
|
|
-
|
|
#ifndef atomic_full_barrier
|
|
# define atomic_full_barrier() __asm ("" ::: "memory")
|
|
#endif
|