Module Name: src
Committed By: christos
Date: Tue Mar 5 22:45:11 UTC 2019
Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: mutex.h witness.h
Log Message:
Fix debugging compilation
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/include/jemalloc/internal/mutex.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/witness.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/jemalloc/include/jemalloc/internal/mutex.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/mutex.h:1.2 src/external/bsd/jemalloc/include/jemalloc/internal/mutex.h:1.3
--- src/external/bsd/jemalloc/include/jemalloc/internal/mutex.h:1.2 Mon Mar 4 14:16:31 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/mutex.h Tue Mar 5 17:45:11 2019
@@ -61,6 +61,9 @@ struct malloc_mutex_s {
#if defined(JEMALLOC_DEBUG)
witness_t witness;
malloc_mutex_lock_order_t lock_order;
+#define LOCK_ORDER_INITIALIZER(field, a) field = a,
+#else
+#define LOCK_ORDER_INITIALIZER(field, a)
#endif
};
@@ -97,24 +100,35 @@ struct malloc_mutex_s {
#ifdef _WIN32
# define MALLOC_MUTEX_INITIALIZER
#elif (defined(JEMALLOC_OS_UNFAIR_LOCK))
-# define MALLOC_MUTEX_INITIALIZER \
- {{{MUTEX_PROF_DATA_INITIALIZER, OS_UNFAIR_LOCK_INIT}}, \
- WITNESS_INITIALIZER("mutex", WITNESS_RANK_OMIT)}
+# define MALLOC_MUTEX_INITIALIZER {{{ \
+ .prof_data = MUTEX_PROF_DATA_INITIALIZER, \
+ .lock = OS_UNFAIR_LOCK_INIT, \
+ }}, \
+ WITNESS_INITIALIZER(.witness, "mutex", WITNESS_RANK_OMIT) \
+ LOCK_ORDER_INITIALIZER(.lock_order, malloc_mutex_rank_exclusive)}
#elif (defined(JEMALLOC_OSSPIN))
-# define MALLOC_MUTEX_INITIALIZER \
- {{{MUTEX_PROF_DATA_INITIALIZER, 0}}, \
- WITNESS_INITIALIZER("mutex", WITNESS_RANK_OMIT)}
+# define MALLOC_MUTEX_INITIALIZER {{{ \
+ .prof_data = MUTEX_PROF_DATA_INITIALIZER, \
+ .lock = 0, \
+ }}, \
+ WITNESS_INITIALIZER(.witness, "mutex", WITNESS_RANK_OMIT) \
+ LOCK_ORDER_INITIALIZER(.lock_order, malloc_mutex_rank_exclusive)}
#elif (defined(JEMALLOC_MUTEX_INIT_CB))
-# define MALLOC_MUTEX_INITIALIZER \
- {{{MUTEX_PROF_DATA_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, NULL}}, \
- WITNESS_INITIALIZER("mutex", WITNESS_RANK_OMIT)}
+# define MALLOC_MUTEX_INITIALIZER {{{ \
+ .prof_data = MUTEX_PROF_DATA_INITIALIZER, \
+ .lock = PTHREAD_MUTEX_INITIALIZER, \
+ .postponed_next = NULL, \
+ }}, \
+ WITNESS_INITIALIZER(.witness, "mutex", WITNESS_RANK_OMIT) \
+ LOCK_ORDER_INITIALIZER(.lock_order, malloc_mutex_rank_exclusive)}
#else
# define MALLOC_MUTEX_TYPE PTHREAD_MUTEX_DEFAULT
-# define MALLOC_MUTEX_INITIALIZER {{{ \
- .prof_data = MUTEX_PROF_DATA_INITIALIZER, \
- .lock = PTHREAD_MUTEX_INITIALIZER, \
- }}, \
- WITNESS_INITIALIZER("mutex", WITNESS_RANK_OMIT)}
+# define MALLOC_MUTEX_INITIALIZER {{{ \
+ .prof_data = MUTEX_PROF_DATA_INITIALIZER, \
+ .lock = PTHREAD_MUTEX_INITIALIZER, \
+ }}, \
+ WITNESS_INITIALIZER(.witness, "mutex", WITNESS_RANK_OMIT) \
+ LOCK_ORDER_INITIALIZER(.lock_order, malloc_mutex_rank_exclusive)}
#endif
#ifdef JEMALLOC_LAZY_LOCK
Index: src/external/bsd/jemalloc/include/jemalloc/internal/witness.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/witness.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/witness.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/witness.h:1.1 Mon Mar 4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/witness.h Tue Mar 5 17:45:11 2019
@@ -65,15 +65,15 @@
/* PER-WITNESS DATA */
/******************************************************************************/
#if defined(JEMALLOC_DEBUG)
-# define WITNESS_INITIALIZER(_name, _rank) { \
+# define WITNESS_INITIALIZER(_field, _name, _rank) _field = { \
.name = _name, \
.rank = _rank, \
.comp = NULL, \
.opaque = NULL, \
.link = { .qre_prev = NULL, .qre_next = NULL }, \
-}
+},
#else
-# define WITNESS_INITIALIZER(name, rank)
+# define WITNESS_INITIALIZER(field, name, rank)
#endif
typedef struct witness_s witness_t;