Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/jemalloc/dist/include/jemalloc/internal Sync wi...



details:   https://anonhg.NetBSD.org/src/rev/e710b31a757c
branches:  trunk
changeset: 449411:e710b31a757c
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Mar 05 22:51:36 2019 +0000

description:
Sync with installed files.

diffstat:

 external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_c11.h |   2 +-
 external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h      |  43 ++++++---
 external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h     |   3 +-
 external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h    |   6 +-
 4 files changed, 33 insertions(+), 21 deletions(-)

diffs (116 lines):

diff -r 201af493c0f6 -r e710b31a757c external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_c11.h
--- a/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_c11.h Tue Mar 05 22:49:38 2019 +0000
+++ b/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_c11.h Tue Mar 05 22:51:36 2019 +0000
@@ -27,7 +27,7 @@
         * 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);                    \
 }                                                                      \
                                                                        \
diff -r 201af493c0f6 -r e710b31a757c external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h
--- a/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h      Tue Mar 05 22:49:38 2019 +0000
+++ b/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h      Tue Mar 05 22:51:36 2019 +0000
@@ -61,6 +61,9 @@
 #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 @@
 #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
diff -r 201af493c0f6 -r e710b31a757c external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h
--- a/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h     Tue Mar 05 22:49:38 2019 +0000
+++ b/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h     Tue Mar 05 22:51:36 2019 +0000
@@ -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);
diff -r 201af493c0f6 -r e710b31a757c external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h
--- a/external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h    Tue Mar 05 22:49:38 2019 +0000
+++ b/external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h    Tue Mar 05 22:51:36 2019 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index