Module Name: src
Committed By: christos
Date: Tue Mar 5 22:51:36 UTC 2019
Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: atomic_c11.h
mutex.h nstime.h witness.h
Log Message:
Sync with installed files.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_c11.h
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h \
src/external/bsd/jemalloc/dist/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/dist/include/jemalloc/internal/atomic_c11.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_c11.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_c11.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_c11.h:1.1.1.1 Mon Mar 4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_c11.h Tue Mar 5 17:51:36 2019
@@ -27,7 +27,7 @@ atomic_load_##short_type(const atomic_##
* convenient for our purposes. This cast is a workaround. \
*/ \
atomic_##short_type##_t* a_nonconst = \
- (atomic_##short_type##_t*)a; \
+ (atomic_##short_type##_t*)(_Atomic void *)(_Atomic uintptr_t)(a); \
return atomic_load_explicit(a_nonconst, mo); \
} \
\
Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h:1.2 src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h:1.3
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h:1.2 Mon Mar 4 12:24:02 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h Tue Mar 5 17:51:36 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,25 +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/dist/include/jemalloc/internal/nstime.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h:1.2 src/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h:1.3
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h:1.2 Mon Mar 4 12:23:10 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h Tue Mar 5 17:51:36 2019
@@ -3,13 +3,12 @@
/* Maximum supported number of seconds (~584 years). */
#define NSTIME_SEC_MAX KQU(18446744072)
-#define NSTIME_INITIALIZER { .ns = 0 }
+#define NSTIME_INITIALIZER { .ns = 0, }
typedef struct {
uint64_t ns;
} nstime_t;
-
void nstime_init(nstime_t *time, uint64_t ns);
void nstime_init2(nstime_t *time, uint64_t sec, uint64_t nsec);
uint64_t nstime_ns(const nstime_t *time);
Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h:1.2 src/external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h:1.3
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h:1.2 Mon Mar 4 15:01:59 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h Tue Mar 5 17:51:36 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;