summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-11-13 19:50:50 +0000
committerUlrich Drepper <drepper@redhat.com>2004-11-13 19:50:50 +0000
commit4f27c49622ee24022f567c23ce0366cc01e14283 (patch)
tree23ed21522253598ab88ee4f0a23ad3bd21c057c1
parentc120d94d58267b1100eb871fcb27a498da129d59 (diff)
2004-11-13 Ulrich Drepper <drepper@redhat.com> * malloc/malloc.c (malloc_state): stat_lock_* elements need only be defined if THREAD_STATS is defined. Remove pad0_ since it does not align with cache line sizes in general anyway.
-rw-r--r--ChangeLog6
-rw-r--r--malloc/malloc.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8defa6a6a9..afb09d8b3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-11-13 Ulrich Drepper <drepper@redhat.com>
+
+ * malloc/malloc.c (malloc_state): stat_lock_* elements need only
+ be defined if THREAD_STATS is defined. Remove pad0_ since it does
+ not align with cache line sizes in general anyway.
+
2004-11-13 Jakub Jelinek <jakub@redhat.com>
* elf/rtld.c (print_statistics): Avoid segfaults if not all namespaces
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 85a9f45861..57074108f1 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2192,10 +2192,12 @@ typedef struct malloc_chunk* mfastbinptr;
struct malloc_state {
/* Serialize access. */
mutex_t mutex;
+ // Should we have padding to move the mutex to its own cache line?
+#if THREAD_STATS
/* Statistics for locking. Only used if THREAD_STATS is defined. */
long stat_lock_direct, stat_lock_loop, stat_lock_wait;
- long pad0_[1]; /* try to give the mutex its own cacheline */
+#endif
/* The maximum chunk size to be eligible for fastbin */
INTERNAL_SIZE_T max_fast; /* low 2 bits used as flags */