mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Make malloc build for no-threads configurations.
This commit is contained in:
11
ChangeLog
11
ChangeLog
@ -1,10 +1,17 @@
|
|||||||
2012-08-17 Roland McGrath <roland@hack.frob.com>
|
2012-08-17 Roland McGrath <roland@hack.frob.com>
|
||||||
|
|
||||||
|
* sysdeps/generic/malloc-machine.h (MUTEX_INITIALIZER): New macro.
|
||||||
|
(atomic_full_barrier, atomic_read_barrier, atomic_write_barrier):
|
||||||
|
Macros removed.
|
||||||
|
* malloc/arena.c (save_malloc_hook, save_free_hook): Conditionalize on
|
||||||
|
[!NO_THREADS].
|
||||||
|
(malloc_atfork, free_atfork, atfork_recursive_cntr): Likewise.
|
||||||
|
(ptmalloc_lock_all, ptmalloc_unlock_all, ptmalloc_unlock_all2):
|
||||||
|
Likewise.
|
||||||
|
|
||||||
* elf/dl-iteratephdr.c (__dl_iterate_phdr): Use NULL rather than 0 for
|
* elf/dl-iteratephdr.c (__dl_iterate_phdr): Use NULL rather than 0 for
|
||||||
__libc_cleanup_push argument.
|
__libc_cleanup_push argument.
|
||||||
|
|
||||||
2012-08-17 Roland McGrath <roland@hack.frob.com>
|
|
||||||
|
|
||||||
* bits/param.h: New file.
|
* bits/param.h: New file.
|
||||||
* misc/sys/param.h: New file.
|
* misc/sys/param.h: New file.
|
||||||
* include/sys/param.h: New file.
|
* include/sys/param.h: New file.
|
||||||
|
@ -141,6 +141,8 @@ int __malloc_initialized = -1;
|
|||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
|
#ifndef NO_THREADS
|
||||||
|
|
||||||
/* atfork support. */
|
/* atfork support. */
|
||||||
|
|
||||||
static __malloc_ptr_t (*save_malloc_hook) (size_t __size,
|
static __malloc_ptr_t (*save_malloc_hook) (size_t __size,
|
||||||
@ -317,6 +319,8 @@ ptmalloc_unlock_all2 (void)
|
|||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
#endif /* !NO_THREADS */
|
||||||
|
|
||||||
/* Initialization routine. */
|
/* Initialization routine. */
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
extern char **_environ;
|
extern char **_environ;
|
||||||
|
@ -1075,9 +1075,10 @@ static void* realloc_check(void* oldmem, size_t bytes,
|
|||||||
const void *caller);
|
const void *caller);
|
||||||
static void* memalign_check(size_t alignment, size_t bytes,
|
static void* memalign_check(size_t alignment, size_t bytes,
|
||||||
const void *caller);
|
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* malloc_atfork(size_t sz, const void *caller);
|
||||||
static void free_atfork(void* mem, const void *caller);
|
static void free_atfork(void* mem, const void *caller);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* ------------- Optional versions of memcopy ---------------- */
|
/* ------------- Optional versions of memcopy ---------------- */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* Basic platform-independent macro definitions for mutexes,
|
/* Basic platform-independent macro definitions for mutexes,
|
||||||
thread-specific data and parameters for malloc.
|
thread-specific data and parameters for malloc.
|
||||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
Copyright (C) 2003-2012 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -38,6 +38,7 @@ typedef int mutex_t;
|
|||||||
# define mutex_lock(m) ((*(m) = 1), 0)
|
# define mutex_lock(m) ((*(m) = 1), 0)
|
||||||
# define mutex_trylock(m) (*(m) ? 1 : ((*(m) = 1), 0))
|
# define mutex_trylock(m) (*(m) ? 1 : ((*(m) = 1), 0))
|
||||||
# define mutex_unlock(m) (*(m) = 0)
|
# define mutex_unlock(m) (*(m) = 0)
|
||||||
|
# define MUTEX_INITIALIZER (0)
|
||||||
|
|
||||||
typedef void *tsd_key_t;
|
typedef void *tsd_key_t;
|
||||||
# define tsd_key_create(key, destr) do {} while(0)
|
# define tsd_key_create(key, destr) do {} while(0)
|
||||||
|
Reference in New Issue
Block a user