mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Cleanup of configuration options
Make several tool features mandatory and simplify the code.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* Malloc implementation for multiple threads without lock contention.
|
||||
Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2009,2010
|
||||
Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2009,2010,2011
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Wolfram Gloger <wg@malloc.de>, 2001.
|
||||
@@ -484,29 +484,6 @@ ptmalloc_init (void)
|
||||
#endif
|
||||
ptmalloc_init_minimal();
|
||||
|
||||
#ifndef NO_THREADS
|
||||
# if defined _LIBC
|
||||
/* We know __pthread_initialize_minimal has already been called,
|
||||
and that is enough. */
|
||||
# define NO_STARTER
|
||||
# endif
|
||||
# ifndef NO_STARTER
|
||||
/* With some threads implementations, creating thread-specific data
|
||||
or initializing a mutex may call malloc() itself. Provide a
|
||||
simple starter version (realloc() won't work). */
|
||||
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;
|
||||
# ifdef _LIBC
|
||||
/* Initialize the pthreads interface. */
|
||||
if (__pthread_initialize != NULL)
|
||||
__pthread_initialize();
|
||||
# endif /* !defined _LIBC */
|
||||
# endif /* !defined NO_STARTER */
|
||||
#endif /* !defined NO_THREADS */
|
||||
mutex_init(&main_arena.mutex);
|
||||
main_arena.next = &main_arena;
|
||||
|
||||
@@ -526,15 +503,6 @@ ptmalloc_init (void)
|
||||
tsd_key_create(&arena_key, NULL);
|
||||
tsd_setspecific(arena_key, (Void_t *)&main_arena);
|
||||
thread_atfork(ptmalloc_lock_all, ptmalloc_unlock_all, ptmalloc_unlock_all2);
|
||||
#ifndef NO_THREADS
|
||||
# ifndef NO_STARTER
|
||||
__malloc_hook = save_malloc_hook;
|
||||
__memalign_hook = save_memalign_hook;
|
||||
__free_hook = save_free_hook;
|
||||
# else
|
||||
# undef NO_STARTER
|
||||
# endif
|
||||
#endif
|
||||
#ifdef _LIBC
|
||||
secure = __libc_enable_secure;
|
||||
s = NULL;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1997,1999,2000,2001,2002,2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1997,1999-2003,2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@@ -21,9 +21,7 @@
|
||||
#include <set-hooks.h>
|
||||
#include <libc-internal.h>
|
||||
|
||||
#ifdef USE_IN_LIBIO
|
||||
# include "../libio/libioP.h"
|
||||
#endif
|
||||
#include "../libio/libioP.h"
|
||||
|
||||
DEFINE_HOOK (__libc_subfreeres, (void));
|
||||
|
||||
@@ -40,9 +38,7 @@ __libc_freeres (void)
|
||||
{
|
||||
void * const *p;
|
||||
|
||||
#ifdef USE_IN_LIBIO
|
||||
_IO_cleanup ();
|
||||
#endif
|
||||
|
||||
RUN_HOOK (__libc_subfreeres, ());
|
||||
|
||||
|
Reference in New Issue
Block a user