This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.16-ports-merge-216-g750c1f2


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  750c1f2a9aefc7b3329283c1b0c95e1a0bb88f14 (commit)
      from  2ae1ae5cf441a90171ff483e3f0de6e8a9d611e4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=750c1f2a9aefc7b3329283c1b0c95e1a0bb88f14

commit 750c1f2a9aefc7b3329283c1b0c95e1a0bb88f14
Author: Roland McGrath <roland@hack.frob.com>
Date:   Fri Aug 17 11:29:45 2012 -0700

    Make malloc build for no-threads configurations.

diff --git a/ChangeLog b/ChangeLog
index fd40eec..62a6916 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,17 @@
 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
 	__libc_cleanup_push argument.
 
-2012-08-17  Roland McGrath  <roland@hack.frob.com>
-
 	* bits/param.h: New file.
 	* misc/sys/param.h: New file.
 	* include/sys/param.h: New file.
diff --git a/malloc/arena.c b/malloc/arena.c
index 06bdd77..9e5e332 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -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>
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 373e063..0f1796c 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -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 ---------------- */
diff --git a/sysdeps/generic/malloc-machine.h b/sysdeps/generic/malloc-machine.h
index 03e9de5..851978a 100644
--- a/sysdeps/generic/malloc-machine.h
+++ b/sysdeps/generic/malloc-machine.h
@@ -1,6 +1,6 @@
 /* Basic platform-independent macro definitions for mutexes,
    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.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -34,10 +34,11 @@
    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)
+# 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)
+# define MUTEX_INITIALIZER      (0)
 
 typedef void *tsd_key_t;
 # define tsd_key_create(key, destr) do {} while(0)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                        |   11 +++++++++--
 malloc/arena.c                   |   12 ++++++++----
 malloc/malloc.c                  |    3 ++-
 sysdeps/generic/malloc-machine.h |   11 ++++++-----
 4 files changed, 25 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]