aboutsummaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-09-10 16:50:28 -0400
committerUlrich Drepper <drepper@gmail.com>2011-09-10 16:50:28 -0400
commitd063d164335938d557460bebaa7cfe388157b627 (patch)
tree92ef3f54771c0a28190b76ee45f90d16fd39714f /malloc
parent3ce1f2959437e952b9db4eaeed2407424f11a4d1 (diff)
downloadglibc-d063d164335938d557460bebaa7cfe388157b627.zip
glibc-d063d164335938d557460bebaa7cfe388157b627.tar.gz
glibc-d063d164335938d557460bebaa7cfe388157b627.tar.bz2
Remove support for !USE___THREAD
Diffstat (limited to 'malloc')
-rw-r--r--malloc/arena.c41
-rw-r--r--malloc/hooks.c2
-rw-r--r--malloc/malloc.c14
3 files changed, 3 insertions, 54 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index 29d8b2d..aab5535 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -173,10 +173,6 @@ int __malloc_initialized = -1;
static __malloc_ptr_t (*save_malloc_hook) (size_t __size,
__const __malloc_ptr_t);
-# if !defined _LIBC || (defined SHARED && !USE___THREAD)
-static __malloc_ptr_t (*save_memalign_hook) (size_t __align, size_t __size,
- __const __malloc_ptr_t);
-# endif
static void (*save_free_hook) (__malloc_ptr_t __ptr,
__const __malloc_ptr_t);
static Void_t* save_arena;
@@ -432,34 +428,6 @@ __failing_morecore (ptrdiff_t d)
extern struct dl_open_hook *_dl_open_hook;
libc_hidden_proto (_dl_open_hook);
# endif
-
-# if defined SHARED && !USE___THREAD
-/* This is called by __pthread_initialize_minimal when it needs to use
- malloc to set up the TLS state. We cannot do the full work of
- ptmalloc_init (below) until __pthread_initialize_minimal has finished,
- so it has to switch to using the special startup-time hooks while doing
- those allocations. */
-void
-__libc_malloc_pthread_startup (bool first_time)
-{
- if (first_time)
- {
- ptmalloc_init_minimal ();
- save_malloc_hook = __malloc_hook;
- save_memalign_hook = __memalign_hook;
- save_free_hook = __free_hook;
- __malloc_hook = malloc_starter;
- __memalign_hook = memalign_starter;
- __free_hook = free_starter;
- }
- else
- {
- __malloc_hook = save_malloc_hook;
- __memalign_hook = save_memalign_hook;
- __free_hook = save_free_hook;
- }
-}
-# endif
#endif
static void
@@ -475,14 +443,7 @@ ptmalloc_init (void)
if(__malloc_initialized >= 0) return;
__malloc_initialized = 0;
-#ifdef _LIBC
-# if defined SHARED && !USE___THREAD
- /* ptmalloc_init_minimal may already have been called via
- __libc_malloc_pthread_startup, above. */
- if (mp_.pagesize == 0)
-# endif
-#endif
- ptmalloc_init_minimal();
+ ptmalloc_init_minimal();
mutex_init(&main_arena.mutex);
main_arena.next = &main_arena;
diff --git a/malloc/hooks.c b/malloc/hooks.c
index 4b1a996..403024c 100644
--- a/malloc/hooks.c
+++ b/malloc/hooks.c
@@ -417,7 +417,7 @@ memalign_check(alignment, bytes, caller)
#ifndef NO_THREADS
# ifdef _LIBC
-# if USE___THREAD || !defined SHARED
+# ifndef SHARED
/* These routines are never needed in this configuration. */
# define NO_STARTER
# endif
diff --git a/malloc/malloc.c b/malloc/malloc.c
index dccb6cc..d7af63d 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1649,19 +1649,7 @@ static Void_t* realloc_check(Void_t* oldmem, size_t bytes,
static Void_t* memalign_check(size_t alignment, size_t bytes,
const Void_t *caller);
#ifndef NO_THREADS
-# ifdef _LIBC
-# if USE___THREAD || !defined SHARED
- /* These routines are never needed in this configuration. */
-# define NO_STARTER
-# endif
-# endif
-# ifdef NO_STARTER
-# undef NO_STARTER
-# else
-static Void_t* malloc_starter(size_t sz, const Void_t *caller);
-static Void_t* memalign_starter(size_t aln, size_t sz, const Void_t *caller);
-static void free_starter(Void_t* mem, const Void_t *caller);
-# endif
+/* These routines are never needed in this configuration. */
static Void_t* malloc_atfork(size_t sz, const Void_t *caller);
static void free_atfork(Void_t* mem, const Void_t *caller);
#endif