CVS commit: src/external/bsd/jemalloc/lib

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 12:41:40 UTC 2021

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
jemalloc: suppress two irrelevant lint warnings


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/jemalloc/lib/Makefile.inc

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/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.14 src/external/bsd/jemalloc/lib/Makefile.inc:1.15
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.14	Tue Jul  6 12:40:24 2021
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Sun Aug 15 12:41:40 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.14 2021/07/06 12:40:24 thorpej Exp $
+#	$NetBSD: Makefile.inc,v 1.15 2021/08/15 12:41:40 rillig Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -44,6 +44,8 @@ witness.c
 CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_PROTECT_NOSTD
 COPTS.${i}+= -fvisibility=hidden -funroll-loops
 COPTS.${i}+= ${${ACTIVE_CC} == "clang":? -Wno-atomic-alignment :}
+LINTFLAGS.${i}+=	-X 231	# argument unused
+LINTFLAGS.${i}+=	-X 220	# fallthrough on case statement
 .endfor
 
 COPTS.background_thread.c+=-Wno-error=stack-protector



CVS commit: src/external/bsd/jemalloc/lib

2021-07-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jul  6 12:40:25 UTC 2021

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
Remove -O0 hack for alpha; root cause has been addressed.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/jemalloc/lib/Makefile.inc

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/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.13 src/external/bsd/jemalloc/lib/Makefile.inc:1.14
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.13	Wed Dec 16 01:21:32 2020
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Tue Jul  6 12:40:24 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.13 2020/12/16 01:21:32 rin Exp $
+#	$NetBSD: Makefile.inc,v 1.14 2021/07/06 12:40:24 thorpej Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -51,14 +51,6 @@ COPTS.ctl.c+=-Wno-error=stack-protector
 COPTS.stats.c+=-Wno-error=stack-protector
 COPTS.tcache.c+=-Wno-error=stack-protector
 
-.if ${MACHINE} == "alpha" && ${ACTIVE_CC} == "gcc"
-# These files need to be compiled with -O0, or build everything with
-# -DJEMALLOC_DEBUG. Otherwise, userland binaries crash randomly, as
-# reported in port-alpha/54307.
-COPTS.rtree.c+=	-O0
-COPTS.tcache.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "vax"
 # in merge_overlapping_regs, at regrename.c
 COPTS.arena.c+=-O0



CVS commit: src/external/bsd/jemalloc/lib

2020-12-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Dec 16 01:21:32 UTC 2020

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
For alpha, apply -O0 hack again to rtree.c for GCC9.
Otherwise, GDB11 crashes in strange ways.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/jemalloc/lib/Makefile.inc

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/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.12 src/external/bsd/jemalloc/lib/Makefile.inc:1.13
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.12	Wed Oct  7 07:35:28 2020
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Wed Dec 16 01:21:32 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.12 2020/10/07 07:35:28 rin Exp $
+#	$NetBSD: Makefile.inc,v 1.13 2020/12/16 01:21:32 rin Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -55,7 +55,7 @@ COPTS.tcache.c+=-Wno-error=stack-protect
 # These files need to be compiled with -O0, or build everything with
 # -DJEMALLOC_DEBUG. Otherwise, userland binaries crash randomly, as
 # reported in port-alpha/54307.
-COPTS.rtree.c+=	${${HAVE_GCC:U0} < 9:? -O0 :}
+COPTS.rtree.c+=	-O0
 COPTS.tcache.c+=-O0
 .endif
 



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2020-12-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Dec 16 01:20:19 UTC 2020

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Correct and extend comments on VA for alpha. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.13 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.14
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.13	Thu Jun  4 00:45:32 2020
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Wed Dec 16 01:20:19 2020
@@ -48,7 +48,14 @@
 #ifdef _LP64
 /* XXX: I will take care of this later */
 # ifdef __alpha__
-#  define LG_VADDR 43	/* bit 42 indicates direct map, 42--63 are same */
+/*
+ * Bit 42 indicates kernel space. Bits 42--63 must be same. For user space,
+ * VA can be regarded to have 43 significant bits with sign-extension to
+ * 64 bits. ``Negative'' addresses are not used in this case. Alternatively,
+ * VA can also be regarded to have 42 significant bits with zero-extension.
+ * See rtree_leaf_elm_bits_extent_get() in rtree.h for more details.
+ */
+#  define LG_VADDR 43
 # else
 #  define LG_VADDR 48
 # endif



CVS commit: src/external/bsd/jemalloc/dist/src

2020-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep  6 16:30:41 UTC 2020

Modified Files:
src/external/bsd/jemalloc/dist/src: malloc_io.c

Log Message:
Appease gcc-9


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/dist/src/malloc_io.c

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/src/malloc_io.c
diff -u src/external/bsd/jemalloc/dist/src/malloc_io.c:1.2 src/external/bsd/jemalloc/dist/src/malloc_io.c:1.3
--- src/external/bsd/jemalloc/dist/src/malloc_io.c:1.2	Mon Mar  4 12:16:27 2019
+++ src/external/bsd/jemalloc/dist/src/malloc_io.c	Sun Sep  6 12:30:41 2020
@@ -362,29 +362,29 @@ malloc_vsnprintf(char *str, size_t size,
 	}\
 } while (0)
 #define GET_ARG_NUMERIC(val, len) do {	\
-	switch (len) {			\
+	switch ((unsigned int)len) {	\
 	case '?':			\
 		val = va_arg(ap, int);	\
 		break;			\
-	case '?' | 0x80:		\
+	case '?' | 0x80U:		\
 		val = va_arg(ap, unsigned int);\
 		break;			\
 	case 'l':			\
 		val = va_arg(ap, long);	\
 		break;			\
-	case 'l' | 0x80:		\
+	case 'l' | 0x80U:		\
 		val = va_arg(ap, unsigned long);			\
 		break;			\
 	case 'q':			\
 		val = va_arg(ap, long long);\
 		break;			\
-	case 'q' | 0x80:		\
+	case 'q' | 0x80U:		\
 		val = va_arg(ap, unsigned long long);			\
 		break;			\
 	case 'j':			\
 		val = va_arg(ap, intmax_t);\
 		break;			\
-	case 'j' | 0x80:		\
+	case 'j' | 0x80U:		\
 		val = va_arg(ap, uintmax_t);\
 		break;			\
 	case 't':			\
@@ -393,7 +393,7 @@ malloc_vsnprintf(char *str, size_t size,
 	case 'z':			\
 		val = va_arg(ap, ssize_t);\
 		break;			\
-	case 'z' | 0x80:		\
+	case 'z' | 0x80U:		\
 		val = va_arg(ap, size_t);\
 		break;			\
 	case 'p': /* Synthetic; used for %p. */\



CVS commit: src/external/bsd/jemalloc/dist/src

2020-05-15 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri May 15 14:34:42 UTC 2020

Modified Files:
src/external/bsd/jemalloc/dist/src: mutex.c

Log Message:
When using default mutex types, don't setup attributes for init.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/dist/src/mutex.c

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/src/mutex.c
diff -u src/external/bsd/jemalloc/dist/src/mutex.c:1.2 src/external/bsd/jemalloc/dist/src/mutex.c:1.3
--- src/external/bsd/jemalloc/dist/src/mutex.c:1.2	Mon Mar  4 17:16:46 2019
+++ src/external/bsd/jemalloc/dist/src/mutex.c	Fri May 15 14:34:41 2020
@@ -157,6 +157,9 @@ malloc_mutex_init(malloc_mutex_t *mutex,
 			return true;
 		}
 	}
+#elif MALLOC_MUTEX_TYPE == PTHREAD_MUTEX_DEFAULT
+	if (pthread_mutex_init(>lock, NULL) == -1)
+		return true;
 #else
 	pthread_mutexattr_t attr;
 



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2020-04-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 21 22:27:09 UTC 2020

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Drop obsolete special case for clang/ppc.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.11 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.12
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.11	Fri Aug  9 08:10:39 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Tue Apr 21 22:27:09 2020
@@ -156,15 +156,7 @@
 
 /* Non-empty if the tls_model attribute is supported. */
 #if !defined(__vax__) && !defined(__mc68010__)
-# if defined(__clang__) && defined(__ppc__) && defined(__pic__)
-/*
- * XXX: In pic mode clang generates PPC32_GOT instead of PPC32_PICGOT for
- * tls model initial-exec. It shouldn't; see PPCISelLowering.h
- */
-#  define JEMALLOC_TLS_MODEL __attribute__((tls_model("global-dynamic")))
-# else
 #  define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
-# endif
 #endif
 
 /*



CVS commit: src/external/bsd/jemalloc/dist/src

2020-02-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Feb 15 09:57:30 UTC 2020

Modified Files:
src/external/bsd/jemalloc/dist/src: tcache.c

Log Message:
jemalloc: Avoid variable length array with length 0

Cherry-pick upstrem patch.

https://github.com/jemalloc/jemalloc/pull/1768


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/tcache.c

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/src/tcache.c
diff -u src/external/bsd/jemalloc/dist/src/tcache.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/tcache.c:1.2
--- src/external/bsd/jemalloc/dist/src/tcache.c:1.1.1.1	Mon Mar  4 17:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/tcache.c	Sat Feb 15 09:57:30 2020
@@ -111,7 +111,8 @@ tcache_bin_flush_small(tsd_t *tsd, tcach
 	arena_t *arena = tcache->arena;
 	assert(arena != NULL);
 	unsigned nflush = tbin->ncached - rem;
-	VARIABLE_ARRAY(extent_t *, item_extent, nflush);
+	/* Variable length array must have > 0 length. */
+	VARIABLE_ARRAY(extent_t *, item_extent, nflush + + 1);
 	/* Look up extent once per item. */
 	for (unsigned i = 0 ; i < nflush; i++) {
 		item_extent[i] = iealloc(tsd_tsdn(tsd), *(tbin->avail - 1 - i));
@@ -196,7 +197,8 @@ tcache_bin_flush_large(tsd_t *tsd, cache
 	arena_t *arena = tcache->arena;
 	assert(arena != NULL);
 	unsigned nflush = tbin->ncached - rem;
-	VARIABLE_ARRAY(extent_t *, item_extent, nflush);
+	/* Variable length array must have > 0 length. */
+	VARIABLE_ARRAY(extent_t *, item_extent, nflush + 1);
 	/* Look up extent once per item. */
 	for (unsigned i = 0 ; i < nflush; i++) {
 		item_extent[i] = iealloc(tsd_tsdn(tsd), *(tbin->avail - 1 - i));



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2020-02-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Feb 14 01:52:35 UTC 2020

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: hash.h

Log Message:
Fix undefined behavior in hash.h (jemalloc)

Cherry-pick upstream patch:

Fix Undefined Behavior in hash.h

hash.h:200:27, left shift of 250 by 24 places cannot be represented in type 
'int'

https://github.com/jemalloc/jemalloc/commit/7fd22f7b2ea5ce2540563ece8e2d30a5316ac857


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/include/jemalloc/internal/hash.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/hash.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/hash.h:1.2 src/external/bsd/jemalloc/include/jemalloc/internal/hash.h:1.3
--- src/external/bsd/jemalloc/include/jemalloc/internal/hash.h:1.2	Mon Mar  4 20:21:18 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/hash.h	Fri Feb 14 01:52:35 2020
@@ -183,21 +183,21 @@ hash_x86_128(const void *key, const int 
 			k4 *= c4; k4 = hash_rotl_32(k4, 18); k4 *= c1; h4 ^= k4;
 			/*FALLTHROUGH*/
 
-		case 12: k3 ^= tail[11] << 24;	/*FALLTHROUGH*/
+		case 12: k3 ^= (uint32_t)tail[11] << 24;	/*FALLTHROUGH*/
 		case 11: k3 ^= tail[10] << 16;	/*FALLTHROUGH*/
 		case 10: k3 ^= tail[ 9] << 8;	/*FALLTHROUGH*/
 		case  9: k3 ^= tail[ 8] << 0;
 			k3 *= c3; k3 = hash_rotl_32(k3, 17); k3 *= c4; h3 ^= k3;
 			/*FALLTHROUGH*/
 
-		case  8: k2 ^= tail[ 7] << 24;	/*FALLTHROUGH*/
+		case  8: k2 ^= (uint32_t)tail[ 7] << 24;	/*FALLTHROUGH*/
 		case  7: k2 ^= tail[ 6] << 16;	/*FALLTHROUGH*/
 		case  6: k2 ^= tail[ 5] << 8;	/*FALLTHROUGH*/
 		case  5: k2 ^= tail[ 4] << 0;
 			k2 *= c2; k2 = hash_rotl_32(k2, 16); k2 *= c3; h2 ^= k2;
 			/*FALLTHROUGH*/
 
-		case  4: k1 ^= tail[ 3] << 24;	/*FALLTHROUGH*/
+		case  4: k1 ^= (uint32_t)tail[ 3] << 24;	/*FALLTHROUGH*/
 		case  3: k1 ^= tail[ 2] << 16;	/*FALLTHROUGH*/
 		case  2: k1 ^= tail[ 1] << 8;	/*FALLTHROUGH*/
 		case  1: k1 ^= tail[ 0] << 0;



CVS commit: src/external/bsd/jemalloc/dist/src

2020-01-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan  6 20:35:11 UTC 2020

Modified Files:
src/external/bsd/jemalloc/dist/src: pages.c

Log Message:
set that NetBSD overcommits (from maya)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/jemalloc/dist/src/pages.c

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/src/pages.c
diff -u src/external/bsd/jemalloc/dist/src/pages.c:1.5 src/external/bsd/jemalloc/dist/src/pages.c:1.6
--- src/external/bsd/jemalloc/dist/src/pages.c:1.5	Fri Apr 26 19:57:59 2019
+++ src/external/bsd/jemalloc/dist/src/pages.c	Mon Jan  6 15:35:11 2020
@@ -592,6 +592,8 @@ pages_boot(void) {
 		mmap_flags |= MAP_NORESERVE;
 	}
 #  endif
+#elif defined(__NetBSD__)
+	os_overcommits = true;
 #else
 	os_overcommits = false;
 #endif



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-05-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May  5 18:14:19 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
PR/54133: Sevan Janiyan: Binaries fail to execute
Prefer MAX_PAGE_SHIFT over PAGE_SHIFT


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.8 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.9
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.8	Fri Apr 26 19:57:00 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Sun May  5 14:14:19 2019
@@ -202,10 +202,10 @@
 
 /* One page is 2^LG_PAGE bytes. */
 #include 
-#if defined(PAGE_SHIFT)
-#define LG_PAGE PAGE_SHIFT
-#elif defined(MAX_PAGE_SHIFT)
+#if defined(MAX_PAGE_SHIFT)
 #define LG_PAGE MAX_PAGE_SHIFT
+#elif defined(PAGE_SHIFT)
+#define LG_PAGE PAGE_SHIFT
 #else
 #error "PAGE_SHIFT is not defined"
 #endif



CVS commit: src/external/bsd/jemalloc/dist/src

2019-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 23:57:59 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: pages.c

Log Message:
Enforce alignment also if the compiled in PAGE_SIZE is bigger than
getpagesize()


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/jemalloc/dist/src/pages.c

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/src/pages.c
diff -u src/external/bsd/jemalloc/dist/src/pages.c:1.4 src/external/bsd/jemalloc/dist/src/pages.c:1.5
--- src/external/bsd/jemalloc/dist/src/pages.c:1.4	Fri Apr 26 10:58:56 2019
+++ src/external/bsd/jemalloc/dist/src/pages.c	Fri Apr 26 19:57:59 2019
@@ -79,9 +79,10 @@ os_pages_map(void *addr, size_t size, si
 	{
 		int flags = mmap_flags;
 #ifdef MAP_ALIGNED
-		int a = ilog2(alignment);
-		if (a > LG_PAGE && a < ilog2(sizeof(void *)))
+		if (alignment > os_page || PAGE > os_page) {
+			int a = ilog2(MAX(alignment, PAGE));
 			flags |= MAP_ALIGNED(a);
+		}
 #endif
 		int prot = *commit ? PAGES_PROT_COMMIT : PAGES_PROT_DECOMMIT;
 



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 23:57:00 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Back to using MAX_PAGE_SHIFT


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.7 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.8
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.7	Thu Apr 18 12:44:25 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Fri Apr 26 19:57:00 2019
@@ -204,8 +204,8 @@
 #include 
 #if defined(PAGE_SHIFT)
 #define LG_PAGE PAGE_SHIFT
-#elif defined(MIN_PAGE_SHIFT)
-#define LG_PAGE MIN_PAGE_SHIFT
+#elif defined(MAX_PAGE_SHIFT)
+#define LG_PAGE MAX_PAGE_SHIFT
 #else
 #error "PAGE_SHIFT is not defined"
 #endif



CVS commit: src/external/bsd/jemalloc/dist/src

2019-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 14:58:56 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: pages.c

Log Message:
Undo previous, it is moving us in the wrong direction.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/jemalloc/dist/src/pages.c

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/src/pages.c
diff -u src/external/bsd/jemalloc/dist/src/pages.c:1.3 src/external/bsd/jemalloc/dist/src/pages.c:1.4
--- src/external/bsd/jemalloc/dist/src/pages.c:1.3	Wed Apr 24 10:34:21 2019
+++ src/external/bsd/jemalloc/dist/src/pages.c	Fri Apr 26 10:58:56 2019
@@ -55,8 +55,8 @@ static void os_pages_unmap(void *addr, s
 
 static void *
 os_pages_map(void *addr, size_t size, size_t alignment, bool *commit) {
-	assert(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, os_page) == addr);
-	assert(os_page != PAGE || ALIGNMENT_CEILING(size, os_page) == size);
+	assert(ALIGNMENT_ADDR2BASE(addr, os_page) == addr);
+	assert(ALIGNMENT_CEILING(size, os_page) == size);
 	assert(size != 0);
 
 	if (os_overcommits) {
@@ -135,8 +135,8 @@ os_pages_trim(void *addr, size_t alloc_s
 
 static void
 os_pages_unmap(void *addr, size_t size) {
-	assert(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, os_page) == addr);
-	assert(os_page != PAGE || ALIGNMENT_CEILING(size, os_page) == size);
+	assert(ALIGNMENT_ADDR2BASE(addr, os_page) == addr);
+	assert(ALIGNMENT_CEILING(size, os_page) == size);
 
 #ifdef _WIN32
 	if (VirtualFree(addr, 0, MEM_RELEASE) == 0)
@@ -187,7 +187,7 @@ pages_map_slow(size_t size, size_t align
 void *
 pages_map(void *addr, size_t size, size_t alignment, bool *commit) {
 	assert(alignment >= PAGE);
-	assert(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, alignment) == addr);
+	assert(ALIGNMENT_ADDR2BASE(addr, alignment) == addr);
 
 	/*
 	 * Ideally, there would be a way to specify alignment to mmap() (like
@@ -570,7 +570,7 @@ label_error:
 bool
 pages_boot(void) {
 	os_page = os_page_detect();
-	if (os_page < PAGE) {
+	if (os_page > PAGE) {
 		malloc_write(": Unsupported system page size\n");
 		if (opt_abort) {
 			abort();



CVS commit: src/external/bsd/jemalloc/dist/src

2019-04-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr 24 14:34:22 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: pages.c tsd.c

Log Message:
Allow os_page sizes greater than the built-in page size. This can happen
for example for COMPAT_NETBSD32 sparc binaries (4K page size because of
MIN_PAGE_SIZE), running on sparc64 (8K pages).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/dist/src/pages.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/tsd.c

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/src/pages.c
diff -u src/external/bsd/jemalloc/dist/src/pages.c:1.2 src/external/bsd/jemalloc/dist/src/pages.c:1.3
--- src/external/bsd/jemalloc/dist/src/pages.c:1.2	Sat Mar 16 18:14:08 2019
+++ src/external/bsd/jemalloc/dist/src/pages.c	Wed Apr 24 10:34:21 2019
@@ -55,8 +55,8 @@ static void os_pages_unmap(void *addr, s
 
 static void *
 os_pages_map(void *addr, size_t size, size_t alignment, bool *commit) {
-	assert(ALIGNMENT_ADDR2BASE(addr, os_page) == addr);
-	assert(ALIGNMENT_CEILING(size, os_page) == size);
+	assert(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, os_page) == addr);
+	assert(os_page != PAGE || ALIGNMENT_CEILING(size, os_page) == size);
 	assert(size != 0);
 
 	if (os_overcommits) {
@@ -135,8 +135,8 @@ os_pages_trim(void *addr, size_t alloc_s
 
 static void
 os_pages_unmap(void *addr, size_t size) {
-	assert(ALIGNMENT_ADDR2BASE(addr, os_page) == addr);
-	assert(ALIGNMENT_CEILING(size, os_page) == size);
+	assert(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, os_page) == addr);
+	assert(os_page != PAGE || ALIGNMENT_CEILING(size, os_page) == size);
 
 #ifdef _WIN32
 	if (VirtualFree(addr, 0, MEM_RELEASE) == 0)
@@ -187,7 +187,7 @@ pages_map_slow(size_t size, size_t align
 void *
 pages_map(void *addr, size_t size, size_t alignment, bool *commit) {
 	assert(alignment >= PAGE);
-	assert(ALIGNMENT_ADDR2BASE(addr, alignment) == addr);
+	assert(os_page != PAGE || ALIGNMENT_ADDR2BASE(addr, alignment) == addr);
 
 	/*
 	 * Ideally, there would be a way to specify alignment to mmap() (like
@@ -570,7 +570,7 @@ label_error:
 bool
 pages_boot(void) {
 	os_page = os_page_detect();
-	if (os_page > PAGE) {
+	if (os_page < PAGE) {
 		malloc_write(": Unsupported system page size\n");
 		if (opt_abort) {
 			abort();

Index: src/external/bsd/jemalloc/dist/src/tsd.c
diff -u src/external/bsd/jemalloc/dist/src/tsd.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/tsd.c:1.2
--- src/external/bsd/jemalloc/dist/src/tsd.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/tsd.c	Wed Apr 24 10:34:21 2019
@@ -39,7 +39,10 @@ struct tsd_init_head_s {
 pthread_key_t tsd_tsd;
 tsd_init_head_t	tsd_init_head = {
 	ql_head_initializer(blocks),
+#ifndef __lint__
+	// XXX: broken lint
 	MALLOC_MUTEX_INITIALIZER
+#endif
 };
 tsd_wrapper_t tsd_boot_wrapper = {
 	false,



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 18 16:44:26 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
no tls for sun2 either.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.6 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.7
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.6	Tue Apr  9 13:00:38 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Thu Apr 18 12:44:25 2019
@@ -151,7 +151,7 @@
 /* #undef JEMALLOC_MUTEX_INIT_CB */
 
 /* Non-empty if the tls_model attribute is supported. */
-#ifndef __vax__
+#if !defined(__vax__) && !defined(__mc68010__)
 #define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
 #endif
 
@@ -235,7 +235,7 @@
 /* #undef JEMALLOC_RETAIN */
 
 /* TLS is used to map arenas and magazine caches to threads. */
-#ifndef __vax__
+#if !defined(__vax__) && !defined(__mc68010__)
 #define JEMALLOC_TLS 
 #endif
 



CVS commit: src/external/bsd/jemalloc/lib

2019-04-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 15 20:40:53 UTC 2019

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
Ignore atomic alignment error for clang


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/jemalloc/lib/Makefile.inc

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/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.8 src/external/bsd/jemalloc/lib/Makefile.inc:1.9
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.8	Fri Mar 29 11:13:44 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Mon Apr 15 16:40:53 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.8 2019/03/29 15:13:44 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.9 2019/04/15 20:40:53 christos Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -39,7 +39,8 @@ witness.c
 .PATH.3: ${JEMALLOC}/dist/doc
 .for i in ${JEMALLOC_SRCS}
 CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_PROTECT_NOSTD -DJEMALLOC_DEBUG
-COPTS.${i}+= -fvisibility=hidden -funroll-loops 
+COPTS.${i}+= -fvisibility=hidden -funroll-loops
+COPTS.${i}+= ${${ACTIVE_CC} == "clang":? -Wno-atomic-alignment :}
 .endfor
 
 COPTS.background_thread.c+=-Wno-error=stack-protector



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-04-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 14 19:13:18 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
tsd_malloc_thread_cleanup.h tsd_tls.h

Log Message:
Declare the tls model in external declarations. Pointed out by joerg.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \

src/external/bsd/jemalloc/include/jemalloc/internal/tsd_malloc_thread_cleanup.h 
\
src/external/bsd/jemalloc/include/jemalloc/internal/tsd_tls.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/tsd_malloc_thread_cleanup.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/tsd_malloc_thread_cleanup.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/tsd_malloc_thread_cleanup.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/tsd_malloc_thread_cleanup.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/tsd_malloc_thread_cleanup.h	Sun Apr 14 15:13:17 2019
@@ -3,8 +3,8 @@
 #endif
 #define JEMALLOC_INTERNAL_TSD_MALLOC_THREAD_CLEANUP_H
 
-extern __thread tsd_t tsd_tls;
-extern __thread bool tsd_initialized;
+extern __thread tsd_t JEMALLOC_TLS_MODEL tsd_tls;
+extern __thread bool JEMALLOC_TLS_MODEL tsd_initialized;
 extern bool tsd_booted;
 
 /* Initialization/cleanup. */
Index: src/external/bsd/jemalloc/include/jemalloc/internal/tsd_tls.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/tsd_tls.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/tsd_tls.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/tsd_tls.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/tsd_tls.h	Sun Apr 14 15:13:17 2019
@@ -3,7 +3,7 @@
 #endif
 #define JEMALLOC_INTERNAL_TSD_TLS_H
 
-extern __thread tsd_t tsd_tls;
+extern __thread tsd_t JEMALLOC_TLS_MODEL tsd_tls;
 extern pthread_key_t tsd_tsd;
 extern bool tsd_booted;
 



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-04-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  9 17:00:38 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Use MIN_PAGE_SHIFT if PAGE_SHIFT is not available instead of MAX_PAGE_SHIFT.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.5 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.6
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.5	Tue Apr  2 17:19:20 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Tue Apr  9 13:00:38 2019
@@ -204,8 +204,8 @@
 #include 
 #if defined(PAGE_SHIFT)
 #define LG_PAGE PAGE_SHIFT
-#elif defined(MAX_PAGE_SHIFT)
-#define LG_PAGE MAX_PAGE_SHIFT
+#elif defined(MIN_PAGE_SHIFT)
+#define LG_PAGE MIN_PAGE_SHIFT
 #else
 #error "PAGE_SHIFT is not defined"
 #endif



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 21:19:20 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Vax ain't having any of that newfangled TLS crap (yet).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.4 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.5
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.4	Fri Mar 29 09:04:00 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Tue Apr  2 17:19:20 2019
@@ -151,7 +151,9 @@
 /* #undef JEMALLOC_MUTEX_INIT_CB */
 
 /* Non-empty if the tls_model attribute is supported. */
+#ifndef __vax__
 #define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
+#endif
 
 /*
  * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables
@@ -233,7 +235,9 @@
 /* #undef JEMALLOC_RETAIN */
 
 /* TLS is used to map arenas and magazine caches to threads. */
+#ifndef __vax__
 #define JEMALLOC_TLS 
+#endif
 
 /*
  * Used to mark unreachable code to quiet "end of non-void" compiler warnings.



CVS commit: src/external/bsd/jemalloc/lib

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 15:13:44 UTC 2019

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
Move all jemalloc symbols to the private namespace. We can't use visibility
because sun2 links statically.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/jemalloc/lib/Makefile.inc

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/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.7 src/external/bsd/jemalloc/lib/Makefile.inc:1.8
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.7	Wed Mar 27 11:30:19 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Fri Mar 29 11:13:44 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.7 2019/03/27 15:30:19 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.8 2019/03/29 15:13:44 christos Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -38,8 +38,7 @@ witness.c
 .SUFFIXES: .3
 .PATH.3: ${JEMALLOC}/dist/doc
 .for i in ${JEMALLOC_SRCS}
-CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_NO_PRIVATE_NAMESPACE \
--DJEMALLOC_PROTECT_NOSTD -DJEMALLOC_DEBUG
+CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_PROTECT_NOSTD -DJEMALLOC_DEBUG
 COPTS.${i}+= -fvisibility=hidden -funroll-loops 
 .endfor
 



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 13:04:01 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
there is no elifdef


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.3 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.4
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.3	Fri Mar 29 08:50:30 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Fri Mar 29 09:04:00 2019
@@ -200,9 +200,9 @@
 
 /* One page is 2^LG_PAGE bytes. */
 #include 
-#ifdef PAGE_SHIFT
+#if defined(PAGE_SHIFT)
 #define LG_PAGE PAGE_SHIFT
-#elifdef MAX_PAGE_SHIFT
+#elif defined(MAX_PAGE_SHIFT)
 #define LG_PAGE MAX_PAGE_SHIFT
 #else
 #error "PAGE_SHIFT is not defined"



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 12:50:30 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Change strategy: instead of always defining PAGE_SHIFT in vmparam.h, fail
back to using MAX_PAGE_SHIFT.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.2 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.3
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.2	Tue Mar  5 17:39:21 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Fri Mar 29 08:50:30 2019
@@ -200,7 +200,13 @@
 
 /* One page is 2^LG_PAGE bytes. */
 #include 
+#ifdef PAGE_SHIFT
 #define LG_PAGE PAGE_SHIFT
+#elifdef MAX_PAGE_SHIFT
+#define LG_PAGE MAX_PAGE_SHIFT
+#else
+#error "PAGE_SHIFT is not defined"
+#endif
 
 /*
  * One huge page is 2^LG_HUGEPAGE bytes.  Note that this is defined even if the



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 28 11:56:56 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: size_classes.h

Log Message:
Add 2K page size tables (sun2)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.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/size_classes.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.3 src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.4
--- src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.3	Wed Mar 27 12:16:14 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h	Thu Mar 28 07:56:56 2019
@@ -4165,6 +4165,470 @@
 #define LARGE_MAXCLASS		size_t)1) << 62) + (((size_t)3) << 60))
 #endif
 
+#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 11)
+#define SIZE_CLASSES \
+  /* index, lg_grp, lg_delta, ndelta, psz, bin, pgs, lg_delta_lookup */ \
+SC(  0,  3,3,  0,  no, yes,   1,  3) \
+SC(  1,  3,3,  1,  no, yes,   1,  3) \
+SC(  2,  3,3,  2,  no, yes,   3,  3) \
+SC(  3,  3,3,  3,  no, yes,   1,  3) \
+ \
+SC(  4,  5,3,  1,  no, yes,   5,  3) \
+SC(  5,  5,3,  2,  no, yes,   3,  3) \
+SC(  6,  5,3,  3,  no, yes,   7,  3) \
+SC(  7,  5,3,  4,  no, yes,   1,  3) \
+ \
+SC(  8,  6,4,  1,  no, yes,   5,  4) \
+SC(  9,  6,4,  2,  no, yes,   3,  4) \
+SC( 10,  6,4,  3,  no, yes,   7,  4) \
+SC( 11,  6,4,  4,  no, yes,   1,  4) \
+ \
+SC( 12,  7,5,  1,  no, yes,   5,  5) \
+SC( 13,  7,5,  2,  no, yes,   3,  5) \
+SC( 14,  7,5,  3,  no, yes,   7,  5) \
+SC( 15,  7,5,  4,  no, yes,   1,  5) \
+ \
+SC( 16,  8,6,  1,  no, yes,   5,  6) \
+SC( 17,  8,6,  2,  no, yes,   3,  6) \
+SC( 18,  8,6,  3,  no, yes,   7,  6) \
+SC( 19,  8,6,  4,  no, yes,   1,  6) \
+ \
+SC( 20,  9,7,  1,  no, yes,   5,  7) \
+SC( 21,  9,7,  2,  no, yes,   3,  7) \
+SC( 22,  9,7,  3,  no, yes,   7,  7) \
+SC( 23,  9,7,  4,  no, yes,   1,  7) \
+ \
+SC( 24, 10,8,  1,  no, yes,   5,  8) \
+SC( 25, 10,8,  2,  no, yes,   3,  8) \
+SC( 26, 10,8,  3,  no, yes,   7,  8) \
+SC( 27, 10,8,  4, yes, yes,   1,  8) \
+ \
+SC( 28, 11,9,  1,  no, yes,   5,  9) \
+SC( 29, 11,9,  2,  no, yes,   3,  9) \
+SC( 30, 11,9,  3,  no, yes,   7,  9) \
+SC( 31, 11,9,  4, yes, yes,   2,  9) \
+ \
+SC( 32, 12,   10,  1,  no, yes,   5, no) \
+SC( 33, 12,   10,  2, yes, yes,   3, no) \
+SC( 34, 12,   10,  3,  no, yes,   7, no) \
+SC( 35, 12,   10,  4, yes,  no,   0, no) \
+ \
+SC( 36, 13,   11,  1, yes,  no,   0, no) \
+SC( 37, 13,   11,  2, yes,  no,   0, no) \
+SC( 38, 13,   11,  3, yes,  no,   0, no) \
+SC( 39, 13,   11,  4, yes,  no,   0, no) \
+ \
+SC( 40, 14,   12,  1, yes,  no,   0, no) \
+SC( 41, 14,   12,  2, yes,  no,   0, no) \
+SC( 42, 14,   12,  3, yes,  no,   0, no) \
+SC( 43, 14,   12,  4, yes,  no,   0, no) \
+ \
+SC( 44, 15,   13,  1, yes,  no,   0, no) \
+SC( 45, 15,   13,  2, yes,  no,   0, no) \
+SC( 46, 15,   13,  3, yes,  no,   0, no) \
+SC( 47, 15,   13,  4, yes,  no,   0, no) \
+ \
+SC( 48, 16,   14,  1, yes,  no,   0, no) \
+SC( 49, 16,   14,  2, yes,  no,   0, no) \
+SC( 50, 16,   14,  3, yes,  no,   0, no) \
+SC( 51, 16,  

CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 17:02:20 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_types.h

Log Message:
alignment for sh3


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.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/jemalloc_internal_types.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.3 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.4
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.3	Wed Mar 27 11:33:52 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h	Wed Mar 27 13:02:20 2019
@@ -97,6 +97,9 @@ typedef int malloc_cpuid_t;
 #  if defined(__riscv) || defined(__riscv__)
 #define LG_QUANTUM		4
 #  endif
+#  ifdef __sh3__
+#define LG_QUANTUM		3
+#  endif
 #  ifdef __s390__
 #define LG_QUANTUM		4
 #  endif



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 16:16:14 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: size_classes.h

Log Message:
add tables for 16K page sizes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.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/size_classes.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.2 src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.3
--- src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.2	Thu Mar 21 05:42:44 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h	Wed Mar 27 12:16:14 2019
@@ -2789,6 +2789,1382 @@
 #define LARGE_MAXCLASS		size_t)1) << 62) + (((size_t)3) << 60))
 #endif
 
+#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 14)
+#define SIZE_CLASSES \
+  /* index, lg_grp, lg_delta, ndelta, psz, bin, pgs, lg_delta_lookup */ \
+SC(  0,  3,3,  0,  no, yes,   1,  3) \
+SC(  1,  3,3,  1,  no, yes,   1,  3) \
+SC(  2,  3,3,  2,  no, yes,   3,  3) \
+SC(  3,  3,3,  3,  no, yes,   1,  3) \
+ \
+SC(  4,  5,3,  1,  no, yes,   5,  3) \
+SC(  5,  5,3,  2,  no, yes,   3,  3) \
+SC(  6,  5,3,  3,  no, yes,   7,  3) \
+SC(  7,  5,3,  4,  no, yes,   1,  3) \
+ \
+SC(  8,  6,4,  1,  no, yes,   5,  4) \
+SC(  9,  6,4,  2,  no, yes,   3,  4) \
+SC( 10,  6,4,  3,  no, yes,   7,  4) \
+SC( 11,  6,4,  4,  no, yes,   1,  4) \
+ \
+SC( 12,  7,5,  1,  no, yes,   5,  5) \
+SC( 13,  7,5,  2,  no, yes,   3,  5) \
+SC( 14,  7,5,  3,  no, yes,   7,  5) \
+SC( 15,  7,5,  4,  no, yes,   1,  5) \
+ \
+SC( 16,  8,6,  1,  no, yes,   5,  6) \
+SC( 17,  8,6,  2,  no, yes,   3,  6) \
+SC( 18,  8,6,  3,  no, yes,   7,  6) \
+SC( 19,  8,6,  4,  no, yes,   1,  6) \
+ \
+SC( 20,  9,7,  1,  no, yes,   5,  7) \
+SC( 21,  9,7,  2,  no, yes,   3,  7) \
+SC( 22,  9,7,  3,  no, yes,   7,  7) \
+SC( 23,  9,7,  4,  no, yes,   1,  7) \
+ \
+SC( 24, 10,8,  1,  no, yes,   5,  8) \
+SC( 25, 10,8,  2,  no, yes,   3,  8) \
+SC( 26, 10,8,  3,  no, yes,   7,  8) \
+SC( 27, 10,8,  4,  no, yes,   1,  8) \
+ \
+SC( 28, 11,9,  1,  no, yes,   5,  9) \
+SC( 29, 11,9,  2,  no, yes,   3,  9) \
+SC( 30, 11,9,  3,  no, yes,   7,  9) \
+SC( 31, 11,9,  4,  no, yes,   1,  9) \
+ \
+SC( 32, 12,   10,  1,  no, yes,   5, no) \
+SC( 33, 12,   10,  2,  no, yes,   3, no) \
+SC( 34, 12,   10,  3,  no, yes,   7, no) \
+SC( 35, 12,   10,  4,  no, yes,   1, no) \
+ \
+SC( 36, 13,   11,  1,  no, yes,   5, no) \
+SC( 37, 13,   11,  2,  no, yes,   3, no) \
+SC( 38, 13,   11,  3,  no, yes,   7, no) \
+SC( 39, 13,   11,  4, yes, yes,   1, no) \
+ \
+SC( 40, 14,   12,  1,  no, yes,   5, no) \
+SC( 41, 14,   12,  2,  no, yes,   3, no) \
+SC( 42, 14,   12,  3,  no, yes,   7, no) \
+SC( 43, 14,   12,  4, yes, yes,   2, no) \
+ \
+SC( 44, 15,   13,  1,  no, yes,   5, no) \
+SC( 45, 15,   13,  2, yes, yes,   3, no) \
+SC( 46, 15,   13,  3,  no, yes,   7, no) \
+SC( 47, 15,   13,  4, yes,  no,   0, no) \
+ \
+SC( 48, 16,   14,  1, yes,  no,   0, no) \
+SC( 49, 16,   14,  2, yes,  no,   0, no) \
+SC( 50, 16,   14,  3, yes,  no,   0, no) \
+SC( 51, 16,  

CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 15:33:52 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_types.h

Log Message:
vaxinate!


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.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/jemalloc_internal_types.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.2 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.3
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.2	Wed Mar 27 08:38:31 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h	Wed Mar 27 11:33:52 2019
@@ -110,6 +110,9 @@ typedef int malloc_cpuid_t;
 #  ifdef __le32__
 #define LG_QUANTUM		4
 #  endif
+#  ifdef __vax__
+#define LG_QUANTUM		4
+#  endif
 #  ifndef LG_QUANTUM
 #error "Unknown minimum alignment for architecture; specify via "
 	 "--with-lg-quantum"



CVS commit: src/external/bsd/jemalloc/lib

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 15:30:19 UTC 2019

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
Handle vax optimizer


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/jemalloc/lib/Makefile.inc

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/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.6 src/external/bsd/jemalloc/lib/Makefile.inc:1.7
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.6	Tue Mar 12 11:13:25 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Wed Mar 27 11:30:19 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.6 2019/03/12 15:13:25 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.7 2019/03/27 15:30:19 christos Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -48,6 +48,12 @@ COPTS.ctl.c+=-Wno-error=stack-protector
 COPTS.stats.c+=-Wno-error=stack-protector
 COPTS.tcache.c+=-Wno-error=stack-protector
 
+.if ${MACHINE_ARCH} == "vax"
+# in merge_overlapping_regs, at regrename.c
+COPTS.arena.c+=-O0
+COPTS.extent.c+=-O0
+.endif
+
 SRCS+=${JEMALLOC_SRCS}
 
 jemalloc.d jemalloc.pico jemalloc.o jemalloc.ln jemalloc.po jemalloc.go: \



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Mar 27 12:38:31 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_types.h

Log Message:
LG_QUANTUM is 4 for both sparc and sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \

src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.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/jemalloc_internal_types.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.1	Mon Mar  4 17:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h	Wed Mar 27 12:38:31 2019
@@ -64,7 +64,7 @@ typedef int malloc_cpuid_t;
 #  ifdef __alpha__
 #define LG_QUANTUM		4
 #  endif
-#  if (defined(__sparc64__) || defined(__sparcv9) || defined(__sparc_v9__))
+#  ifdef __sparc__
 #define LG_QUANTUM		4
 #  endif
 #  if (defined(__amd64__) || defined(__x86_64__) || defined(_M_X64))



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar 21 09:42:44 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: size_classes.h

Log Message:
Add size variants for architectures with PGSHIFT = 13


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.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/size_classes.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.1	Mon Mar  4 17:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h	Thu Mar 21 09:42:44 2019
@@ -1413,6 +1413,1382 @@
 #define LARGE_MAXCLASS		size_t)1) << 62) + (((size_t)3) << 60))
 #endif
 
+#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 13)
+#define SIZE_CLASSES \
+  /* index, lg_grp, lg_delta, ndelta, psz, bin, pgs, lg_delta_lookup */ \
+SC(  0,  3,3,  0,  no, yes,   1,  3) \
+SC(  1,  3,3,  1,  no, yes,   1,  3) \
+SC(  2,  3,3,  2,  no, yes,   3,  3) \
+SC(  3,  3,3,  3,  no, yes,   1,  3) \
+ \
+SC(  4,  5,3,  1,  no, yes,   5,  3) \
+SC(  5,  5,3,  2,  no, yes,   3,  3) \
+SC(  6,  5,3,  3,  no, yes,   7,  3) \
+SC(  7,  5,3,  4,  no, yes,   1,  3) \
+ \
+SC(  8,  6,4,  1,  no, yes,   5,  4) \
+SC(  9,  6,4,  2,  no, yes,   3,  4) \
+SC( 10,  6,4,  3,  no, yes,   7,  4) \
+SC( 11,  6,4,  4,  no, yes,   1,  4) \
+ \
+SC( 12,  7,5,  1,  no, yes,   5,  5) \
+SC( 13,  7,5,  2,  no, yes,   3,  5) \
+SC( 14,  7,5,  3,  no, yes,   7,  5) \
+SC( 15,  7,5,  4,  no, yes,   1,  5) \
+ \
+SC( 16,  8,6,  1,  no, yes,   5,  6) \
+SC( 17,  8,6,  2,  no, yes,   3,  6) \
+SC( 18,  8,6,  3,  no, yes,   7,  6) \
+SC( 19,  8,6,  4,  no, yes,   1,  6) \
+ \
+SC( 20,  9,7,  1,  no, yes,   5,  7) \
+SC( 21,  9,7,  2,  no, yes,   3,  7) \
+SC( 22,  9,7,  3,  no, yes,   7,  7) \
+SC( 23,  9,7,  4,  no, yes,   1,  7) \
+ \
+SC( 24, 10,8,  1,  no, yes,   5,  8) \
+SC( 25, 10,8,  2,  no, yes,   3,  8) \
+SC( 26, 10,8,  3,  no, yes,   7,  8) \
+SC( 27, 10,8,  4,  no, yes,   1,  8) \
+ \
+SC( 28, 11,9,  1,  no, yes,   5,  9) \
+SC( 29, 11,9,  2,  no, yes,   3,  9) \
+SC( 30, 11,9,  3,  no, yes,   7,  9) \
+SC( 31, 11,9,  4,  no, yes,   1,  9) \
+ \
+SC( 32, 12,   10,  1,  no, yes,   5, no) \
+SC( 33, 12,   10,  2,  no, yes,   3, no) \
+SC( 34, 12,   10,  3,  no, yes,   7, no) \
+SC( 35, 12,   10,  4, yes, yes,   1, no) \
+ \
+SC( 36, 13,   11,  1,  no, yes,   5, no) \
+SC( 37, 13,   11,  2,  no, yes,   3, no) \
+SC( 38, 13,   11,  3,  no, yes,   7, no) \
+SC( 39, 13,   11,  4, yes, yes,   2, no) \
+ \
+SC( 40, 14,   12,  1,  no, yes,   5, no) \
+SC( 41, 14,   12,  2, yes, yes,   3, no) \
+SC( 42, 14,   12,  3,  no, yes,   7, no) \
+SC( 43, 14,   12,  4, yes,  no,   0, no) \
+ \
+SC( 44, 15,   13,  1, yes,  no,   0, no) \
+SC( 45, 15,   13,  2, yes,  no,   0, no) \
+SC( 46, 15,   13,  3, yes,  no,   0, no) \
+SC( 47, 15,   13,  4, yes,  no,   0, no) \
+ \
+SC( 48, 16,   14,  1, yes,  no,   0, no) \
+SC( 49, 16,   14,  2, yes,  no,   0, no) \
+SC( 50, 16,   14,  3, yes,  no,   0, no) \

CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 16 22:14:09 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: pages.c

Log Message:
we have MAP_ALIGNED, so use it (although it does not do anything by default)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/pages.c

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/src/pages.c
diff -u src/external/bsd/jemalloc/dist/src/pages.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/pages.c:1.2
--- src/external/bsd/jemalloc/dist/src/pages.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/pages.c	Sat Mar 16 18:14:08 2019
@@ -14,6 +14,9 @@
 #include 
 #endif
 #endif
+#ifdef MAP_ALIGNED
+#include 	/* NetBSD */
+#endif
 
 /**/
 /* Data. */
@@ -74,9 +77,15 @@ os_pages_map(void *addr, size_t size, si
 	 * of existing mappings, and we only want to create new mappings.
 	 */
 	{
+		int flags = mmap_flags;
+#ifdef MAP_ALIGNED
+		int a = ilog2(alignment);
+		if (a > LG_PAGE && a < ilog2(sizeof(void *)))
+			flags |= MAP_ALIGNED(a);
+#endif
 		int prot = *commit ? PAGES_PROT_COMMIT : PAGES_PROT_DECOMMIT;
 
-		ret = mmap(addr, size, prot, mmap_flags, -1, 0);
+		ret = mmap(addr, size, prot, flags, -1, 0);
 	}
 	assert(ret != NULL);
 



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 16 21:32:04 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: extent.c

Log Message:
PR/54062: Fix the "snprintf_float" test failing after the jemalloc import
issue: jemalloc uses a lot more memory (if it can find it) by default and
this test limited the amount of memory it could get, causing it to get to
an error path with a missing mutex_unlock...


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/jemalloc/dist/src/extent.c

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/src/extent.c
diff -u src/external/bsd/jemalloc/dist/src/extent.c:1.3 src/external/bsd/jemalloc/dist/src/extent.c:1.4
--- src/external/bsd/jemalloc/dist/src/extent.c:1.3	Sun Mar 10 15:34:30 2019
+++ src/external/bsd/jemalloc/dist/src/extent.c	Sat Mar 16 17:32:04 2019
@@ -748,6 +748,7 @@ extent_register_impl(tsdn_t *tsdn, exten
 
 	if (extent_rtree_leaf_elms_lookup(tsdn, rtree_ctx, extent, false, true,
 	_a, _b)) {
+		extent_unlock(tsdn, extent);
 		return true;
 	}
 



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 21:49:32 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: jemalloc.c

Log Message:
revert previous sshd hack (from Rin Okuyama)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/jemalloc/dist/src/jemalloc.c

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/src/jemalloc.c
diff -u src/external/bsd/jemalloc/dist/src/jemalloc.c:1.6 src/external/bsd/jemalloc/dist/src/jemalloc.c:1.7
--- src/external/bsd/jemalloc/dist/src/jemalloc.c:1.6	Tue Mar 12 11:13:25 2019
+++ src/external/bsd/jemalloc/dist/src/jemalloc.c	Thu Mar 14 17:49:32 2019
@@ -2339,14 +2339,9 @@ je_realloc(void *ptr, size_t size) {
 tcache = NULL;
 			}
 			ifree(tsd, ptr, tcache, true);
-#ifdef notyet
-			/*
-			 * sshd depends on realloc(p, 0) returning non-NULL
-			 * disable for compatibility for now
-			 */
+
 			LOG("core.realloc.exit", "result: %p", NULL);
 			return NULL;
-#endif
 		}
 		size = 1;
 	}



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 21:10:33 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: arena.c

Log Message:
Grr, disable the "time goes backwards" test here since this breaks too
frequently. We need a real fix.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/dist/src/arena.c

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/src/arena.c
diff -u src/external/bsd/jemalloc/dist/src/arena.c:1.2 src/external/bsd/jemalloc/dist/src/arena.c:1.3
--- src/external/bsd/jemalloc/dist/src/arena.c:1.2	Mon Mar 11 14:06:28 2019
+++ src/external/bsd/jemalloc/dist/src/arena.c	Thu Mar 14 17:10:33 2019
@@ -642,9 +642,11 @@ arena_maybe_decay(tsdn_t *tsdn, arena_t 
 		 */
 		nstime_copy(>epoch, );
 		arena_decay_deadline_init(decay);
+#ifndef __NetBSD__
 	} else {
 		/* Verify that time does not go backwards. */
 		assert(nstime_compare(>epoch, ) <= 0);
+#endif
 	}
 
 	/*



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 18:59:37 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal:
arena_externs.h arena_inlines_a.h arena_inlines_b.h
atomic_gcc_atomic.h prof_inlines_a.h prof_inlines_b.h

Log Message:
Sync with installed versions.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h \

src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/prof_inlines_a.h
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/prof_inlines_b.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/arena_externs.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h:1.1.1.1	Mon Mar  4 12:10:22 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h	Thu Mar 14 14:59:37 2019
@@ -56,8 +56,8 @@ void *arena_malloc_hard(tsdn_t *tsdn, ar
 szind_t ind, bool zero);
 void *arena_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize,
 size_t alignment, bool zero, tcache_t *tcache);
-void arena_prof_promote(tsdn_t *tsdn, const void *ptr, size_t usize);
-void arena_dalloc_promoted(tsdn_t *tsdn, void *ptr, tcache_t *tcache,
+JEMALLOC_NORETURN void arena_prof_promote(tsdn_t *tsdn, const void *ptr, size_t usize);
+JEMALLOC_NORETURN void arena_dalloc_promoted(tsdn_t *tsdn, void *ptr, tcache_t *tcache,
 bool slow_path);
 void arena_dalloc_bin_junked_locked(tsdn_t *tsdn, arena_t *arena,
 extent_t *extent, void *ptr);
Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h:1.1.1.1	Mon Mar  4 12:10:22 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h	Thu Mar 14 14:59:37 2019
@@ -32,7 +32,7 @@ arena_prof_accum(tsdn_t *tsdn, arena_t *
 	return prof_accum_add(tsdn, >prof_accum, accumbytes);
 }
 
-static inline void
+static JEMALLOC_NORETURN inline void
 percpu_arena_update(tsd_t *tsd, unsigned cpu) {
 	assert(have_percpu_arena);
 	arena_t *oldarena = tsd_arena_get(tsd);
Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h:1.1.1.1	Mon Mar  4 12:10:22 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h	Thu Mar 14 14:59:37 2019
@@ -27,7 +27,7 @@ arena_prof_tctx_get(tsdn_t *tsdn, const 
 	return (prof_tctx_t *)(uintptr_t)1U;
 }
 
-JEMALLOC_ALWAYS_INLINE void
+JEMALLOC_NORETURN JEMALLOC_ALWAYS_INLINE void
 arena_prof_tctx_set(tsdn_t *tsdn, const void *ptr, UNUSED size_t usize,
 alloc_ctx_t *alloc_ctx, prof_tctx_t *tctx) {
 	cassert(config_prof);
@@ -46,7 +46,7 @@ arena_prof_tctx_set(tsdn_t *tsdn, const 
 	}
 }
 
-static inline void
+static JEMALLOC_NORETURN inline void
 arena_prof_tctx_reset(tsdn_t *tsdn, const void *ptr, UNUSED prof_tctx_t *tctx) {
 	cassert(config_prof);
 	assert(ptr != NULL);
Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h	Thu Mar 14 14:59:37 2019
@@ -36,8 +36,7 @@ atomic_fence(atomic_memory_order_t mo) {
 	__atomic_thread_fence(atomic_enum_to_builtin(mo));
 }
 
-#define JEMALLOC_GENERATE_ATOMICS(type, short_type,			\
-/* unused */ lg_size)		\
+#define JEMALLOC_GENERATE_ATOMICS(type, short_type, lg_size)		\
 typedef struct {			\
 	type repr;			\
 } atomic_##short_type##_t;		\
@@ -85,8 +84,7 @@ atomic_compare_exchange_strong_##short_t
 }
 
 
-#define JEMALLOC_GENERATE_INT_ATOMICS(type, short_type,			\
-/* unused */ lg_size)		\
+#define 

CVS commit: src/external/bsd/jemalloc

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 18:56:12 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: prof.c
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_preamble.h

Log Message:
Remove __clang___ hacks for noreturn, reduce footprint when we don't compile
with JEMALLOC_PROF. More to do here.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/jemalloc/dist/src/prof.c
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_preamble.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/src/prof.c
diff -u src/external/bsd/jemalloc/dist/src/prof.c:1.3 src/external/bsd/jemalloc/dist/src/prof.c:1.4
--- src/external/bsd/jemalloc/dist/src/prof.c:1.3	Sun Mar 10 15:34:30 2019
+++ src/external/bsd/jemalloc/dist/src/prof.c	Thu Mar 14 14:56:12 2019
@@ -78,7 +78,9 @@ size_t		lg_prof_sample;
  * creating/destroying mutexes.
  */
 static malloc_mutex_t	*gctx_locks;
+#ifdef JEMALLOC_PROF
 static atomic_u_t	cum_gctxs; /* Atomic counter. */
+#endif
 
 /*
  * Table of mutexes that are shared among tdata's.  No operations require
@@ -103,14 +105,18 @@ malloc_mutex_t		bt2gctx_mtx;
 static prof_tdata_tree_t	tdatas;
 static malloc_mutex_t	tdatas_mtx;
 
+#ifdef JEMALLOC_PROF
 static uint64_t		next_thr_uid;
+#endif
 static malloc_mutex_t	next_thr_uid_mtx;
 
 static malloc_mutex_t	prof_dump_seq_mtx;
+#ifdef JEMALLOC_PROF
 static uint64_t		prof_dump_seq;
 static uint64_t		prof_dump_iseq;
 static uint64_t		prof_dump_mseq;
 static uint64_t		prof_dump_useq;
+#endif
 
 /*
  * This buffer is rather large for stack allocation, so use a single buffer for
@@ -128,8 +134,10 @@ static char		prof_dump_buf[
 static size_t		prof_dump_buf_end;
 static int		prof_dump_fd;
 
+#ifdef JEMALLOC_PROF
 /* Do not dump any profiles until bootstrapping is complete. */
 static bool		prof_booted = false;
+#endif
 
 /**/
 /*
@@ -143,7 +151,9 @@ static bool	prof_tdata_should_destroy(ts
 bool even_if_attached);
 static void	prof_tdata_destroy(tsd_t *tsd, prof_tdata_t *tdata,
 bool even_if_attached);
+#ifdef JEMALLOC_PROF
 static char	*prof_thread_name_alloc(tsdn_t *tsdn, const char *thread_name);
+#endif
 
 /**/
 /* Red-black trees. */
@@ -207,7 +217,7 @@ rb_gen(static UNUSED, tdata_tree_, prof_
 
 /**/
 
-JEMALLOC_NORETURN void
+JEMALLOC_PROF_NORETURN void
 prof_alloc_rollback(tsd_t *tsd, prof_tctx_t *tctx, bool updated) {
 	prof_tdata_t *tdata;
 
@@ -237,7 +247,7 @@ prof_alloc_rollback(tsd_t *tsd, prof_tct
 	}
 }
 
-JEMALLOC_NORETURN void
+JEMALLOC_PROF_NORETURN void
 prof_malloc_sample_object(tsdn_t *tsdn, const void *ptr, size_t usize,
 prof_tctx_t *tctx) {
 	prof_tctx_set(tsdn, ptr, usize, NULL, tctx);
@@ -268,7 +278,7 @@ prof_free_sampled_object(tsd_t *tsd, siz
 	}
 }
 
-JEMALLOC_NORETURN void
+JEMALLOC_PROF_NORETURN void
 bt_init(prof_bt_t *bt, void **vec) {
 	cassert(config_prof);
 
@@ -276,7 +286,7 @@ bt_init(prof_bt_t *bt, void **vec) {
 	bt->len = 0;
 }
 
-static JEMALLOC_NORETURN void
+static JEMALLOC_PROF_NORETURN void
 prof_enter(tsd_t *tsd, prof_tdata_t *tdata) {
 	cassert(config_prof);
 	assert(tdata == prof_tdata_get(tsd, false));
@@ -289,7 +299,7 @@ prof_enter(tsd_t *tsd, prof_tdata_t *tda
 	malloc_mutex_lock(tsd_tsdn(tsd), _mtx);
 }
 
-static JEMALLOC_NORETURN void
+static JEMALLOC_PROF_NORETURN void
 prof_leave(tsd_t *tsd, prof_tdata_t *tdata) {
 	cassert(config_prof);
 	assert(tdata == prof_tdata_get(tsd, false));
@@ -537,6 +547,7 @@ prof_backtrace(prof_bt_t *bt) {
 }
 #endif
 
+#ifdef JEMALLOC_PROF
 static malloc_mutex_t *
 prof_gctx_mutex_choose(void) {
 	unsigned ngctxs = atomic_fetch_add_u(_gctxs, 1, ATOMIC_RELAXED);
@@ -574,8 +585,9 @@ prof_gctx_create(tsdn_t *tsdn, prof_bt_t
 	gctx->bt.len = bt->len;
 	return gctx;
 }
+#endif
 
-static JEMALLOC_NORETURN void
+static JEMALLOC_PROF_NORETURN void
 prof_gctx_try_destroy(tsd_t *tsd, prof_tdata_t *tdata_self, prof_gctx_t *gctx,
 prof_tdata_t *tdata) {
 	cassert(config_prof);
@@ -716,6 +728,7 @@ prof_tctx_destroy(tsd_t *tsd, prof_tctx_
 	}
 }
 
+#ifdef JEMALLOC_PROF
 static bool
 prof_lookup_global(tsd_t *tsd, prof_bt_t *bt, prof_tdata_t *tdata,
 void **p_btkey, prof_gctx_t **p_gctx, bool *p_new_gctx) {
@@ -780,9 +793,12 @@ prof_lookup_global(tsd_t *tsd, prof_bt_t
 	*p_new_gctx = new_gctx;
 	return false;
 }
+#endif
 
-prof_tctx_t *
+JEMALLOC_PROF_NORETURN prof_tctx_t *
 prof_lookup(tsd_t *tsd, prof_bt_t *bt) {
+	cassert(config_prof);
+#ifdef JEMALLOC_PROF
 	union {
 		prof_tctx_t	*p;
 		void		*v;
@@ -790,8 +806,6 @@ prof_lookup(tsd_t *tsd, prof_bt_t *bt) {
 	prof_tdata_t *tdata;
 	bool 

CVS commit: src/external/bsd/jemalloc

2019-03-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 12 15:13:25 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: jemalloc.c
src/external/bsd/jemalloc/include/jemalloc: jemalloc.h
src/external/bsd/jemalloc/lib: Makefile Makefile.inc
Added Files:
src/external/bsd/jemalloc: Makefile
src/external/bsd/jemalloc/lib: jemalloc_stub.c

Log Message:
- descend to build libjemalloc
- namespace protect all functions __je
- provide getters and setters for malloc_conf and malloc_message


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/jemalloc/Makefile
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/jemalloc/dist/src/jemalloc.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/jemalloc/include/jemalloc/jemalloc.h
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/lib/Makefile
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/jemalloc/lib/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/external/bsd/jemalloc/lib/jemalloc_stub.c

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/src/jemalloc.c
diff -u src/external/bsd/jemalloc/dist/src/jemalloc.c:1.5 src/external/bsd/jemalloc/dist/src/jemalloc.c:1.6
--- src/external/bsd/jemalloc/dist/src/jemalloc.c:1.5	Sun Mar 10 15:34:30 2019
+++ src/external/bsd/jemalloc/dist/src/jemalloc.c	Tue Mar 12 11:13:25 2019
@@ -20,24 +20,31 @@
 #include "jemalloc/internal/ticker.h"
 #include "jemalloc/internal/util.h"
 
-__weak_alias(mallocx, je_mallocx)
-__weak_alias(rallocx, je_rallocx)
-__weak_alias(xallocx, je_xallocx)
-__weak_alias(sallocx, je_sallocx)
-__weak_alias(dallocx, je_dallocx)
-__weak_alias(sdallocx, je_sdallocx)
-__weak_alias(nallocx, je_nallocx)
-
-__weak_alias(mallctl, je_mallctl)
-__weak_alias(mallctlnametomib, je_mallctlnametomib)
-__weak_alias(mallctlbymib, je_mallctlbymib)
+#ifdef JEMALLOC_WEAK_NOSTD
+__weak_alias(mallocx, __je_mallocx)
+__weak_alias(rallocx, __je_rallocx)
+__weak_alias(xallocx, __je_xallocx)
+__weak_alias(sallocx, __je_sallocx)
+__weak_alias(dallocx, __je_dallocx)
+__weak_alias(sdallocx, __je_sdallocx)
+__weak_alias(nallocx, __je_nallocx)
+
+__weak_alias(mallctl, __je_mallctl)
+__weak_alias(mallctlnametomib, __je_mallctlnametomib)
+__weak_alias(mallctlbymib, __je_mallctlbymib)
+
+__weak_alias(malloc_stats_print, __je_malloc_stats_print)
+__weak_alias(malloc_usable_size, __je_malloc_usable_size)
 
-__weak_alias(malloc_stats_print, je_malloc_stats_print)
-__weak_alias(malloc_usable_size, je_malloc_usable_size)
+__weak_alias(malloc_message, __je_malloc_message)
+__weak_alias(malloc_conf, __je_malloc_conf)
 
-__weak_alias(malloc_message, je_malloc_message)
+__weak_alias(malloc_message_get, __je_malloc_message_get)
+__weak_alias(malloc_conf_get, __je_malloc_conf_get)
 
-__weak_alias(malloc_conf, je_malloc_conf)
+__weak_alias(malloc_message_set, __je_malloc_message_set)
+__weak_alias(malloc_conf_set, __je_malloc_conf_set)
+#endif
 
 /**/
 /* Data. */
@@ -3354,4 +3361,28 @@ jemalloc_postfork_child(void) {
 	ctl_postfork_child(tsd_tsdn(tsd));
 }
 
+void (*
+je_malloc_message_get(void))(void *, const char *)
+{
+	return je_malloc_message;
+}
+
+void
+je_malloc_message_set(void (*m)(void *, const char *))
+{
+	je_malloc_message = m;
+}
+
+const char *
+je_malloc_conf_get(void)
+{
+	return je_malloc_conf;
+}
+
+void
+je_malloc_conf_set(const char *m)
+{
+	je_malloc_conf = m;
+}
+
 /**/

Index: src/external/bsd/jemalloc/include/jemalloc/jemalloc.h
diff -u src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.5 src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.6
--- src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.5	Sun Mar 10 15:32:56 2019
+++ src/external/bsd/jemalloc/include/jemalloc/jemalloc.h	Tue Mar 12 11:13:25 2019
@@ -64,48 +64,51 @@ extern "C" {
 #ifndef JEMALLOC_NO_RENAME
 #  define je_aligned_alloc aligned_alloc
 #  define je_calloc calloc
-#  define je_dallocx dallocx
 #  define je_free free
+#  define je_malloc malloc
+#  define je_posix_memalign posix_memalign
+#  define je_realloc realloc
+#  define je_valloc valloc
+
+# ifndef JEMALLOC_PROTECT_NOSTD
+#  define je_dallocx dallocx
 #  define je_mallctl mallctl
 #  define je_mallctlbymib mallctlbymib
 #  define je_mallctlnametomib mallctlnametomib
-#  define je_malloc malloc
 #  define je_malloc_conf malloc_conf
+#  define je_malloc_conf_get malloc_conf_get
+#  define je_malloc_conf_set malloc_conf_set
 #  define je_malloc_message malloc_message
+#  define je_malloc_message_get malloc_message_get
+#  define je_malloc_message_set malloc_message_set
 #  define je_malloc_stats_print malloc_stats_print
 #  define je_malloc_usable_size malloc_usable_size
 #  define je_mallocx mallocx
 #  define je_nallocx nallocx
-#  define je_posix_memalign posix_memalign
 #  

CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar 11 18:06:28 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: arena.c

Log Message:
Add an initializatin that is not needed when the optimizer works...


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/arena.c

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/src/arena.c
diff -u src/external/bsd/jemalloc/dist/src/arena.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/arena.c:1.2
--- src/external/bsd/jemalloc/dist/src/arena.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/arena.c	Mon Mar 11 14:06:28 2019
@@ -867,7 +867,8 @@ arena_decay_impl(tsdn_t *tsdn, arena_t *
 	if (epoch_advanced) {
 		/* Backlog is updated on epoch advance. */
 		npages_new = decay->backlog[SMOOTHSTEP_NSTEPS-1];
-	}
+	} else
+		npages_new = 0;	// XXX: gcc without -O
 	malloc_mutex_unlock(tsdn, >mtx);
 
 	if (have_background_thread && background_thread_enabled() &&



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 10 21:52:00 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: prof_inlines_a.h

Log Message:
one more noreturn


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/prof_inlines_a.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/prof_inlines_a.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/prof_inlines_a.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/prof_inlines_a.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/prof_inlines_a.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/prof_inlines_a.h	Sun Mar 10 17:52:00 2019
@@ -41,7 +41,7 @@ prof_accum_add(tsdn_t *tsdn, prof_accum_
 	return overflow;
 }
 
-static inline void
+static JEMALLOC_NORETURN inline void
 prof_accum_cancel(tsdn_t *tsdn, prof_accum_t *prof_accum, size_t usize) {
 	cassert(config_prof);
 



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 10 19:34:30 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: extent.c jemalloc.c prof.c rtree.c
witness.c

Log Message:
Add noreturn where needed. In the prof case because of cassert() and return
in some functions we disable the cassert() for clang. We should really have
a JEMALLOC_PROF_NORETURN and a way to mark the remaining of the function
unreachable.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/dist/src/extent.c \
src/external/bsd/jemalloc/dist/src/prof.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/jemalloc/dist/src/jemalloc.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/rtree.c \
src/external/bsd/jemalloc/dist/src/witness.c

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/src/extent.c
diff -u src/external/bsd/jemalloc/dist/src/extent.c:1.2 src/external/bsd/jemalloc/dist/src/extent.c:1.3
--- src/external/bsd/jemalloc/dist/src/extent.c:1.2	Mon Mar  4 12:20:07 2019
+++ src/external/bsd/jemalloc/dist/src/extent.c	Sun Mar 10 15:34:30 2019
@@ -697,7 +697,7 @@ extent_interior_register(tsdn_t *tsdn, r
 	}
 }
 
-static void
+static JEMALLOC_NORETURN void
 extent_gdump_add(tsdn_t *tsdn, const extent_t *extent) {
 	cassert(config_prof);
 	/* prof_gdump() requirement. */
@@ -723,7 +723,7 @@ extent_gdump_add(tsdn_t *tsdn, const ext
 	}
 }
 
-static void
+static JEMALLOC_NORETURN void
 extent_gdump_sub(tsdn_t *tsdn, const extent_t *extent) {
 	cassert(config_prof);
 
Index: src/external/bsd/jemalloc/dist/src/prof.c
diff -u src/external/bsd/jemalloc/dist/src/prof.c:1.2 src/external/bsd/jemalloc/dist/src/prof.c:1.3
--- src/external/bsd/jemalloc/dist/src/prof.c:1.2	Mon Mar  4 12:18:53 2019
+++ src/external/bsd/jemalloc/dist/src/prof.c	Sun Mar 10 15:34:30 2019
@@ -207,7 +207,7 @@ rb_gen(static UNUSED, tdata_tree_, prof_
 
 /**/
 
-void
+JEMALLOC_NORETURN void
 prof_alloc_rollback(tsd_t *tsd, prof_tctx_t *tctx, bool updated) {
 	prof_tdata_t *tdata;
 
@@ -237,7 +237,7 @@ prof_alloc_rollback(tsd_t *tsd, prof_tct
 	}
 }
 
-void
+JEMALLOC_NORETURN void
 prof_malloc_sample_object(tsdn_t *tsdn, const void *ptr, size_t usize,
 prof_tctx_t *tctx) {
 	prof_tctx_set(tsdn, ptr, usize, NULL, tctx);
@@ -268,7 +268,7 @@ prof_free_sampled_object(tsd_t *tsd, siz
 	}
 }
 
-void
+JEMALLOC_NORETURN void
 bt_init(prof_bt_t *bt, void **vec) {
 	cassert(config_prof);
 
@@ -276,7 +276,7 @@ bt_init(prof_bt_t *bt, void **vec) {
 	bt->len = 0;
 }
 
-static void
+static JEMALLOC_NORETURN void
 prof_enter(tsd_t *tsd, prof_tdata_t *tdata) {
 	cassert(config_prof);
 	assert(tdata == prof_tdata_get(tsd, false));
@@ -289,7 +289,7 @@ prof_enter(tsd_t *tsd, prof_tdata_t *tda
 	malloc_mutex_lock(tsd_tsdn(tsd), _mtx);
 }
 
-static void
+static JEMALLOC_NORETURN void
 prof_leave(tsd_t *tsd, prof_tdata_t *tdata) {
 	cassert(config_prof);
 	assert(tdata == prof_tdata_get(tsd, false));
@@ -530,7 +530,7 @@ prof_backtrace(prof_bt_t *bt) {
 #undef BT_FRAME
 }
 #else
-void
+JEMALLOC_NORETURN void
 prof_backtrace(prof_bt_t *bt) {
 	cassert(config_prof);
 	not_reached();
@@ -575,7 +575,7 @@ prof_gctx_create(tsdn_t *tsdn, prof_bt_t
 	return gctx;
 }
 
-static void
+static JEMALLOC_NORETURN void
 prof_gctx_try_destroy(tsd_t *tsd, prof_tdata_t *tdata_self, prof_gctx_t *gctx,
 prof_tdata_t *tdata) {
 	cassert(config_prof);
@@ -1175,7 +1175,7 @@ label_return:
 	return ret;
 }
 
-static void
+static JEMALLOC_NORETURN void
 prof_dump_gctx_prep(tsdn_t *tsdn, prof_gctx_t *gctx, prof_gctx_tree_t *gctxs) {
 	cassert(config_prof);
 
@@ -1548,7 +1548,7 @@ label_return:
 	return ret;
 }
 
-static void
+static JEMALLOC_NORETURN void
 prof_dump_prep(tsd_t *tsd, prof_tdata_t *tdata,
 struct prof_tdata_merge_iter_arg_s *prof_tdata_merge_iter_arg,
 struct prof_gctx_merge_iter_arg_s *prof_gctx_merge_iter_arg,
@@ -1719,7 +1719,7 @@ prof_cnt_all(uint64_t *curobjs, uint64_t
 
 #define DUMP_FILENAME_BUFSIZE	(PATH_MAX + 1)
 #define VSEQ_INVALID		UINT64_C(0x)
-static void
+static JEMALLOC_NORETURN void
 prof_dump_filename(char *filename, char v, uint64_t vseq) {
 	cassert(config_prof);
 
@@ -1741,8 +1741,9 @@ static void
 prof_fdump(void) {
 	tsd_t *tsd;
 	char filename[DUMP_FILENAME_BUFSIZE];
-
+#ifndef __clang__
 	cassert(config_prof);
+#endif
 	assert(opt_prof_final);
 	assert(opt_prof_prefix[0] != '\0');
 
@@ -1778,8 +1779,9 @@ void
 prof_idump(tsdn_t *tsdn) {
 	tsd_t *tsd;
 	prof_tdata_t *tdata;
-
+#ifndef __clang__
 	cassert(config_prof);
+#endif
 
 	if (!prof_booted || tsdn_null(tsdn) || !prof_active_get_unlocked()) {
 		return;
@@ -1835,8 +1837,9 @@ void
 prof_gdump(tsdn_t *tsdn) {
 	tsd_t *tsd;
 	prof_tdata_t *tdata;
-
+#ifndef __clang__
 	cassert(config_prof);
+#endif
 
 	if (!prof_booted 

CVS commit: src/external/bsd/jemalloc/include/jemalloc

2019-03-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 10 19:32:56 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc: jemalloc.h
src/external/bsd/jemalloc/include/jemalloc/internal: arena_externs.h
arena_inlines_a.h arena_inlines_b.h atomic_gcc_atomic.h
prof_inlines_b.h

Log Message:
Add noreturn for the benefit of clang


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/jemalloc/include/jemalloc/jemalloc.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/arena_externs.h \
src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_a.h \
src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_b.h \
src/external/bsd/jemalloc/include/jemalloc/internal/atomic_gcc_atomic.h \
src/external/bsd/jemalloc/include/jemalloc/internal/prof_inlines_b.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/jemalloc.h
diff -u src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.4 src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.5
--- src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.4	Sun Mar 10 11:45:26 2019
+++ src/external/bsd/jemalloc/include/jemalloc/jemalloc.h	Sun Mar 10 15:32:56 2019
@@ -169,6 +169,7 @@ extern "C" {
 #if defined(_MSC_VER)
 #  define JEMALLOC_ATTR(s)
 #  define JEMALLOC_ALIGNED(s) __declspec(align(s))
+#  define JEMALLOC_NORETURN
 #  define JEMALLOC_ALLOC_SIZE(s)
 #  define JEMALLOC_ALLOC_SIZE2(s1, s2)
 #  ifndef JEMALLOC_EXPORT
@@ -195,6 +196,7 @@ extern "C" {
 #elif defined(JEMALLOC_HAVE_ATTR)
 #  define JEMALLOC_ATTR(s) __attribute__((s))
 #  define JEMALLOC_ALIGNED(s) JEMALLOC_ATTR(aligned(s))
+#  define JEMALLOC_NORETURN JEMALLOC_ATTR(__noreturn__)
 #  ifdef JEMALLOC_HAVE_ATTR_ALLOC_SIZE
 #define JEMALLOC_ALLOC_SIZE(s) JEMALLOC_ATTR(alloc_size(s))
 #define JEMALLOC_ALLOC_SIZE2(s1, s2) JEMALLOC_ATTR(alloc_size(s1, s2))

Index: src/external/bsd/jemalloc/include/jemalloc/internal/arena_externs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/arena_externs.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/arena_externs.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/arena_externs.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/arena_externs.h	Sun Mar 10 15:32:56 2019
@@ -56,8 +56,8 @@ void *arena_malloc_hard(tsdn_t *tsdn, ar
 szind_t ind, bool zero);
 void *arena_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize,
 size_t alignment, bool zero, tcache_t *tcache);
-void arena_prof_promote(tsdn_t *tsdn, const void *ptr, size_t usize);
-void arena_dalloc_promoted(tsdn_t *tsdn, void *ptr, tcache_t *tcache,
+JEMALLOC_NORETURN void arena_prof_promote(tsdn_t *tsdn, const void *ptr, size_t usize);
+JEMALLOC_NORETURN void arena_dalloc_promoted(tsdn_t *tsdn, void *ptr, tcache_t *tcache,
 bool slow_path);
 void arena_dalloc_bin_junked_locked(tsdn_t *tsdn, arena_t *arena,
 extent_t *extent, void *ptr);
Index: src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_a.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_a.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_a.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_a.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_a.h	Sun Mar 10 15:32:56 2019
@@ -32,7 +32,7 @@ arena_prof_accum(tsdn_t *tsdn, arena_t *
 	return prof_accum_add(tsdn, >prof_accum, accumbytes);
 }
 
-static inline void
+static JEMALLOC_NORETURN inline void
 percpu_arena_update(tsd_t *tsd, unsigned cpu) {
 	assert(have_percpu_arena);
 	arena_t *oldarena = tsd_arena_get(tsd);
Index: src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_b.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_b.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_b.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_b.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/arena_inlines_b.h	Sun Mar 10 15:32:56 2019
@@ -27,7 +27,7 @@ arena_prof_tctx_get(tsdn_t *tsdn, const 
 	return (prof_tctx_t *)(uintptr_t)1U;
 }
 
-JEMALLOC_ALWAYS_INLINE void
+JEMALLOC_NORETURN JEMALLOC_ALWAYS_INLINE void
 arena_prof_tctx_set(tsdn_t *tsdn, const void *ptr, UNUSED size_t usize,
 alloc_ctx_t *alloc_ctx, prof_tctx_t *tctx) {
 	cassert(config_prof);
@@ -46,7 +46,7 @@ arena_prof_tctx_set(tsdn_t *tsdn, const 
 	}
 }
 
-static inline void
+static JEMALLOC_NORETURN inline void
 arena_prof_tctx_reset(tsdn_t *tsdn, const void *ptr, UNUSED prof_tctx_t *tctx) {
 	cassert(config_prof);
 	assert(ptr != NULL);
Index: src/external/bsd/jemalloc/include/jemalloc/internal/atomic_gcc_atomic.h
diff -u 

CVS commit: src/external/bsd/jemalloc/include/jemalloc

2019-03-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 10 15:45:26 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc: jemalloc.h jemalloc_defs.h

Log Message:
clang does not have the gnu_printf attribute


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/jemalloc/include/jemalloc/jemalloc.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/jemalloc_defs.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/jemalloc.h
diff -u src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.3 src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.4
--- src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.3	Sun Mar 10 06:00:29 2019
+++ src/external/bsd/jemalloc/include/jemalloc/jemalloc.h	Sun Mar 10 11:45:26 2019
@@ -11,7 +11,9 @@ extern "C" {
 #define JEMALLOC_HAVE_ATTR_ALLOC_SIZE
 
 /* Defined if format(gnu_printf, ...) attribute is supported. */
+#ifndef __clang__
 #define JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF
+#endif
 
 /* Defined if format(printf, ...) attribute is supported. */
 #define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF

Index: src/external/bsd/jemalloc/include/jemalloc/jemalloc_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/jemalloc_defs.h:1.1 src/external/bsd/jemalloc/include/jemalloc/jemalloc_defs.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/jemalloc_defs.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/jemalloc_defs.h	Sun Mar 10 11:45:26 2019
@@ -5,8 +5,10 @@
 /* Defined if alloc_size attribute is supported. */
 #define JEMALLOC_HAVE_ATTR_ALLOC_SIZE 
 
+#ifndef __clang__
 /* Defined if format(gnu_printf, ...) attribute is supported. */
 #define JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF 
+#endif
 
 /* Defined if format(printf, ...) attribute is supported. */
 #define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF 



CVS commit: src/external/bsd/jemalloc/lib

2019-03-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 10 15:32:42 UTC 2019

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
turn on debugging to help find problems.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/jemalloc/lib/Makefile.inc

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/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.4 src/external/bsd/jemalloc/lib/Makefile.inc:1.5
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.4	Sat Mar  9 21:49:52 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Sun Mar 10 11:32:42 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.4 2019/03/10 02:49:52 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.5 2019/03/10 15:32:42 christos Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -39,7 +39,7 @@ witness.c
 .PATH.3: ${JEMALLOC}/dist/doc
 .for i in ${JEMALLOC_SRCS}
 CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_NO_PRIVATE_NAMESPACE \
--DJEMALLOC_WEAK_NOSTD
+-DJEMALLOC_WEAK_NOSTD -DJEMALLOC_DEBUG
 COPTS.${i}+= -fvisibility=hidden -funroll-loops 
 .endfor
 



CVS commit: src/external/bsd/jemalloc

2019-03-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Mar 10 10:00:29 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: jemalloc.c
src/external/bsd/jemalloc/include/jemalloc: jemalloc.h

Log Message:
Rename je_mallctltomib to je_mallctlnametomib

This unbreaks the build.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/jemalloc/dist/src/jemalloc.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/include/jemalloc/jemalloc.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/src/jemalloc.c
diff -u src/external/bsd/jemalloc/dist/src/jemalloc.c:1.3 src/external/bsd/jemalloc/dist/src/jemalloc.c:1.4
--- src/external/bsd/jemalloc/dist/src/jemalloc.c:1.3	Sun Mar 10 02:49:52 2019
+++ src/external/bsd/jemalloc/dist/src/jemalloc.c	Sun Mar 10 10:00:29 2019
@@ -29,7 +29,7 @@ __weak_alias(sdallocx, je_sdallocx)
 __weak_alias(nallocx, je_nallocx)
 
 __weak_alias(mallctl, je_mallctl)
-__weak_alias(mallctltomib, je_mallctltomib)
+__weak_alias(mallctlnametomib, je_mallctlnametomib)
 __weak_alias(mallctlbymib, je_mallctlbymib)
 
 __weak_alias(malloc_stats_print, je_malloc_stats_print)

Index: src/external/bsd/jemalloc/include/jemalloc/jemalloc.h
diff -u src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.2 src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.3
--- src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.2	Sun Mar 10 02:49:52 2019
+++ src/external/bsd/jemalloc/include/jemalloc/jemalloc.h	Sun Mar 10 10:00:29 2019
@@ -94,7 +94,7 @@ extern "C" {
 #undef je_nallocx
 
 #undef je_mallctl
-#undef je_mallctltomib
+#undef je_mallctlnametomib
 #undef je_mallctlbymib
 
 #undef je_malloc_stats_print



CVS commit: src/external/bsd/jemalloc

2019-03-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 10 02:49:52 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: jemalloc.c
src/external/bsd/jemalloc/include/jemalloc: jemalloc.h
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
Make the non-standard jemalloc api weak.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/dist/src/jemalloc.c
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/jemalloc.h
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/jemalloc/lib/Makefile.inc

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/src/jemalloc.c
diff -u src/external/bsd/jemalloc/dist/src/jemalloc.c:1.2 src/external/bsd/jemalloc/dist/src/jemalloc.c:1.3
--- src/external/bsd/jemalloc/dist/src/jemalloc.c:1.2	Mon Mar  4 12:18:27 2019
+++ src/external/bsd/jemalloc/dist/src/jemalloc.c	Sat Mar  9 21:49:52 2019
@@ -1,3 +1,5 @@
+#include 
+
 #define JEMALLOC_C_
 #include "jemalloc/internal/jemalloc_preamble.h"
 #include "jemalloc/internal/jemalloc_internal_includes.h"
@@ -18,6 +20,25 @@
 #include "jemalloc/internal/ticker.h"
 #include "jemalloc/internal/util.h"
 
+__weak_alias(mallocx, je_mallocx)
+__weak_alias(rallocx, je_rallocx)
+__weak_alias(xallocx, je_xallocx)
+__weak_alias(sallocx, je_sallocx)
+__weak_alias(dallocx, je_dallocx)
+__weak_alias(sdallocx, je_sdallocx)
+__weak_alias(nallocx, je_nallocx)
+
+__weak_alias(mallctl, je_mallctl)
+__weak_alias(mallctltomib, je_mallctltomib)
+__weak_alias(mallctlbymib, je_mallctlbymib)
+
+__weak_alias(malloc_stats_print, je_malloc_stats_print)
+__weak_alias(malloc_usable_size, je_malloc_usable_size)
+
+__weak_alias(malloc_message, je_malloc_message)
+
+__weak_alias(malloc_conf, je_malloc_conf)
+
 /**/
 /* Data. */
 

Index: src/external/bsd/jemalloc/include/jemalloc/jemalloc.h
diff -u src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.1 src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/jemalloc.h	Sat Mar  9 21:49:52 2019
@@ -83,6 +83,29 @@ extern "C" {
 #  define je_valloc valloc
 #endif
 
+#ifdef JEMALLOC_WEAK_NOSTD
+
+#undef je_mallocx
+#undef je_rallocx
+#undef je_xallocx
+#undef je_sallocx
+#undef je_dallocx
+#undef je_sdallocx
+#undef je_nallocx
+
+#undef je_mallctl
+#undef je_mallctltomib
+#undef je_mallctlbymib
+
+#undef je_malloc_stats_print
+#undef je_malloc_usable_size
+
+#undef je_malloc_message
+
+#undef je_malloc_conf
+
+#endif
+
 #include 
 #include 
 #include 

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.3 src/external/bsd/jemalloc/lib/Makefile.inc:1.4
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.3	Fri Mar  8 15:00:21 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Sat Mar  9 21:49:52 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.3 2019/03/08 20:00:21 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.4 2019/03/10 02:49:52 christos Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -38,7 +38,8 @@ witness.c
 .SUFFIXES: .3
 .PATH.3: ${JEMALLOC}/dist/doc
 .for i in ${JEMALLOC_SRCS}
-CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_NO_PRIVATE_NAMESPACE
+CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_NO_PRIVATE_NAMESPACE \
+-DJEMALLOC_WEAK_NOSTD
 COPTS.${i}+= -fvisibility=hidden -funroll-loops 
 .endfor
 



CVS commit: src/external/bsd/jemalloc/lib

2019-03-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar  8 20:00:21 UTC 2019

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
Arrange for the new man page to be installed.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/lib/Makefile.inc

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/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.2 src/external/bsd/jemalloc/lib/Makefile.inc:1.3
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.2	Mon Mar  4 14:41:51 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Fri Mar  8 15:00:21 2019
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile.inc,v 1.2 2019/03/04 19:41:51 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2019/03/08 20:00:21 christos Exp $
 
-JEMALLOC:=${.PARSEDIR}/../
+JEMALLOC:=${.PARSEDIR}/..
 
 JEMALLOC_SRCS+= \
 jemalloc.c \
@@ -35,6 +35,8 @@ tsd.c \
 witness.c
 
 .PATH: ${JEMALLOC}/dist/src ${JEMALLOC}/lib
+.SUFFIXES: .3
+.PATH.3: ${JEMALLOC}/dist/doc
 .for i in ${JEMALLOC_SRCS}
 CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_NO_PRIVATE_NAMESPACE
 COPTS.${i}+= -fvisibility=hidden -funroll-loops 



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-05 Thread Christos Zoulas
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 

CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-05 Thread Christos Zoulas
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;



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  5 22:39:21 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Add some XXX for things I need to fix later, and fix some of the hard-coding.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Tue Mar  5 17:39:21 2019
@@ -33,9 +33,12 @@
  * Hyper-threaded CPUs may need a special instruction inside spin loops in
  * order to yield to another virtual CPU.
  */
+#ifdef __x86_64__
+/* XXX: I will take care of this later */
 #define CPU_SPINWAIT __asm__ volatile("pause")
 /* 1 if CPU_SPINWAIT is defined, 0 otherwise. */
 #define HAVE_CPU_SPINWAIT 1
+#endif
 
 /*
  * Number of significant bits in virtual addresses.  This may be less than the
@@ -43,6 +46,7 @@
  * bits are the same as bit 47.
  */
 #ifdef _LP64
+/* XXX: I will take care of this later */
 #define LG_VADDR 48
 #else
 #define LG_VADDR 32
@@ -195,7 +199,8 @@
 /* #undef LG_QUANTUM */
 
 /* One page is 2^LG_PAGE bytes. */
-#define LG_PAGE 12
+#include 
+#define LG_PAGE PAGE_SHIFT
 
 /*
  * One huge page is 2^LG_HUGEPAGE bytes.  Note that this is defined even if the
@@ -311,7 +316,10 @@
 #define JEMALLOC_HAS_RESTRICT 1
 
 /* For use by hash code. */
-/* #undef JEMALLOC_BIG_ENDIAN */
+#include 
+#if _BYTE_ORDER == _BIG_ENDIAN
+#define JEMALLOC_BIG_ENDIAN 1
+#endif
 
 /* sizeof(int) == 2^LG_SIZEOF_INT. */
 #define LG_SIZEOF_INT 2



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  5 22:37:39 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: atomic_c11.h

Log Message:
fix const cast with custom "unconst"


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/atomic_c11.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/atomic_c11.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/atomic_c11.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/atomic_c11.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/atomic_c11.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/atomic_c11.h	Tue Mar  5 17:37:39 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);			\
 }	\
 	\



CVS commit: src/external/bsd/jemalloc

2019-03-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  5 22:35:45 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: ph.h
src/external/bsd/jemalloc/include/jemalloc/internal: ph.h

Log Message:
revert previous; not needed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/include/jemalloc/internal/ph.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/ph.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h:1.3 src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h:1.4
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h:1.3	Tue Mar  5 10:18:59 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h	Tue Mar  5 17:35:45 2019
@@ -374,13 +374,11 @@ a_prefix##remove(a_ph_type *ph, a_type *
 parent);\
 			}		\
 		} else {		\
-			a_type *prev = phn_prev_get(a_type, a_field, 	\
-			phn);	\
-			if (prev != NULL) {\
-phn_next_set(a_type, a_field, prev,	\
-phn_next_get(a_type, a_field,	\
-phn));\
-			}		\
+			assert(phn_prev_get(a_type, a_field, phn) !=	\
+			NULL);	\
+			phn_next_set(a_type, a_field,			\
+			phn_prev_get(a_type, a_field, phn),		\
+			phn_next_get(a_type, a_field, phn));	\
 		}			\
 		if (phn_next_get(a_type, a_field, phn) != NULL) {	\
 			phn_prev_set(a_type, a_field,			\

Index: src/external/bsd/jemalloc/include/jemalloc/internal/ph.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/ph.h:1.2 src/external/bsd/jemalloc/include/jemalloc/internal/ph.h:1.3
--- src/external/bsd/jemalloc/include/jemalloc/internal/ph.h:1.2	Tue Mar  5 10:18:59 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/ph.h	Tue Mar  5 17:35:45 2019
@@ -374,13 +374,11 @@ a_prefix##remove(a_ph_type *ph, a_type *
 parent);\
 			}		\
 		} else {		\
-			a_type *prev = phn_prev_get(a_type, a_field, 	\
-			phn);	\
-			if (prev != NULL) {\
-phn_next_set(a_type, a_field, prev,	\
-phn_next_get(a_type, a_field,	\
-phn));\
-			}		\
+			assert(phn_prev_get(a_type, a_field, phn) !=	\
+			NULL);	\
+			phn_next_set(a_type, a_field,			\
+			phn_prev_get(a_type, a_field, phn),		\
+			phn_next_get(a_type, a_field, phn));	\
 		}			\
 		if (phn_next_get(a_type, a_field, phn) != NULL) {	\
 			phn_prev_set(a_type, a_field,			\



CVS commit: src/external/bsd/jemalloc

2019-03-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  5 15:18:59 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: ph.h
src/external/bsd/jemalloc/include/jemalloc/internal: ph.h

Log Message:
Check that the previous link exists before merging it.
XXX: Is that right? Fixing this makes the h_resolve test work.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/ph.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/ph.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h:1.2 src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h:1.3
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h:1.2	Mon Mar  4 15:06:31 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h	Tue Mar  5 10:18:59 2019
@@ -374,11 +374,13 @@ a_prefix##remove(a_ph_type *ph, a_type *
 parent);\
 			}		\
 		} else {		\
-			assert(phn_prev_get(a_type, a_field, phn) !=	\
-			NULL);	\
-			phn_next_set(a_type, a_field,			\
-			phn_prev_get(a_type, a_field, phn),		\
-			phn_next_get(a_type, a_field, phn));	\
+			a_type *prev = phn_prev_get(a_type, a_field, 	\
+			phn);	\
+			if (prev != NULL) {\
+phn_next_set(a_type, a_field, prev,	\
+phn_next_get(a_type, a_field,	\
+phn));\
+			}		\
 		}			\
 		if (phn_next_get(a_type, a_field, phn) != NULL) {	\
 			phn_prev_set(a_type, a_field,			\

Index: src/external/bsd/jemalloc/include/jemalloc/internal/ph.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/ph.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/ph.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/ph.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/ph.h	Tue Mar  5 10:18:59 2019
@@ -374,11 +374,13 @@ a_prefix##remove(a_ph_type *ph, a_type *
 parent);\
 			}		\
 		} else {		\
-			assert(phn_prev_get(a_type, a_field, phn) !=	\
-			NULL);	\
-			phn_next_set(a_type, a_field,			\
-			phn_prev_get(a_type, a_field, phn),		\
-			phn_next_get(a_type, a_field, phn));	\
+			a_type *prev = phn_prev_get(a_type, a_field, 	\
+			phn);	\
+			if (prev != NULL) {\
+phn_next_set(a_type, a_field, prev,	\
+phn_next_get(a_type, a_field,	\
+phn));\
+			}		\
 		}			\
 		if (phn_next_get(a_type, a_field, phn) != NULL) {	\
 			phn_prev_set(a_type, a_field,			\



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:22:04 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: hash.h

Log Message:
Add FALLTHROUGH comments.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/hash.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/hash.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/hash.h:1.2 src/external/bsd/jemalloc/dist/include/jemalloc/internal/hash.h:1.3
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/hash.h:1.2	Mon Mar  4 15:04:09 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/hash.h	Mon Mar  4 15:22:04 2019
@@ -177,26 +177,29 @@ hash_x86_128(const void *key, const int 
 		uint32_t k4 = 0;
 
 		switch (len & 15) {
-		case 15: k4 ^= tail[14] << 16;
-		case 14: k4 ^= tail[13] << 8;
+		case 15: k4 ^= tail[14] << 16;	/*FALLTHROUGH*/
+		case 14: k4 ^= tail[13] << 8;	/*FALLTHROUGH*/
 		case 13: k4 ^= tail[12] << 0;
 			k4 *= c4; k4 = hash_rotl_32(k4, 18); k4 *= c1; h4 ^= k4;
+			/*FALLTHROUGH*/
 
-		case 12: k3 ^= tail[11] << 24;
-		case 11: k3 ^= tail[10] << 16;
-		case 10: k3 ^= tail[ 9] << 8;
+		case 12: k3 ^= tail[11] << 24;	/*FALLTHROUGH*/
+		case 11: k3 ^= tail[10] << 16;	/*FALLTHROUGH*/
+		case 10: k3 ^= tail[ 9] << 8;	/*FALLTHROUGH*/
 		case  9: k3 ^= tail[ 8] << 0;
-		 k3 *= c3; k3 = hash_rotl_32(k3, 17); k3 *= c4; h3 ^= k3;
+			k3 *= c3; k3 = hash_rotl_32(k3, 17); k3 *= c4; h3 ^= k3;
+			/*FALLTHROUGH*/
 
-		case  8: k2 ^= tail[ 7] << 24;
-		case  7: k2 ^= tail[ 6] << 16;
-		case  6: k2 ^= tail[ 5] << 8;
+		case  8: k2 ^= tail[ 7] << 24;	/*FALLTHROUGH*/
+		case  7: k2 ^= tail[ 6] << 16;	/*FALLTHROUGH*/
+		case  6: k2 ^= tail[ 5] << 8;	/*FALLTHROUGH*/
 		case  5: k2 ^= tail[ 4] << 0;
 			k2 *= c2; k2 = hash_rotl_32(k2, 16); k2 *= c3; h2 ^= k2;
+			/*FALLTHROUGH*/
 
-		case  4: k1 ^= tail[ 3] << 24;
-		case  3: k1 ^= tail[ 2] << 16;
-		case  2: k1 ^= tail[ 1] << 8;
+		case  4: k1 ^= tail[ 3] << 24;	/*FALLTHROUGH*/
+		case  3: k1 ^= tail[ 2] << 16;	/*FALLTHROUGH*/
+		case  2: k1 ^= tail[ 1] << 8;	/*FALLTHROUGH*/
 		case  1: k1 ^= tail[ 0] << 0;
 			k1 *= c1; k1 = hash_rotl_32(k1, 15); k1 *= c2; h1 ^= k1;
 		}



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:21:18 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: hash.h

Log Message:
Add fallthough comments.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/hash.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/hash.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/hash.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/hash.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/hash.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/hash.h	Mon Mar  4 15:21:18 2019
@@ -177,26 +177,29 @@ hash_x86_128(const void *key, const int 
 		uint32_t k4 = 0;
 
 		switch (len & 15) {
-		case 15: k4 ^= tail[14] << 16;
-		case 14: k4 ^= tail[13] << 8;
+		case 15: k4 ^= tail[14] << 16;	/*FALLTHROUGH*/
+		case 14: k4 ^= tail[13] << 8;	/*FALLTHROUGH*/
 		case 13: k4 ^= tail[12] << 0;
 			k4 *= c4; k4 = hash_rotl_32(k4, 18); k4 *= c1; h4 ^= k4;
+			/*FALLTHROUGH*/
 
-		case 12: k3 ^= tail[11] << 24;
-		case 11: k3 ^= tail[10] << 16;
-		case 10: k3 ^= tail[ 9] << 8;
+		case 12: k3 ^= tail[11] << 24;	/*FALLTHROUGH*/
+		case 11: k3 ^= tail[10] << 16;	/*FALLTHROUGH*/
+		case 10: k3 ^= tail[ 9] << 8;	/*FALLTHROUGH*/
 		case  9: k3 ^= tail[ 8] << 0;
-		 k3 *= c3; k3 = hash_rotl_32(k3, 17); k3 *= c4; h3 ^= k3;
+			k3 *= c3; k3 = hash_rotl_32(k3, 17); k3 *= c4; h3 ^= k3;
+			/*FALLTHROUGH*/
 
-		case  8: k2 ^= tail[ 7] << 24;
-		case  7: k2 ^= tail[ 6] << 16;
-		case  6: k2 ^= tail[ 5] << 8;
+		case  8: k2 ^= tail[ 7] << 24;	/*FALLTHROUGH*/
+		case  7: k2 ^= tail[ 6] << 16;	/*FALLTHROUGH*/
+		case  6: k2 ^= tail[ 5] << 8;	/*FALLTHROUGH*/
 		case  5: k2 ^= tail[ 4] << 0;
 			k2 *= c2; k2 = hash_rotl_32(k2, 16); k2 *= c3; h2 ^= k2;
+			/*FALLTHROUGH*/
 
-		case  4: k1 ^= tail[ 3] << 24;
-		case  3: k1 ^= tail[ 2] << 16;
-		case  2: k1 ^= tail[ 1] << 8;
+		case  4: k1 ^= tail[ 3] << 24;	/*FALLTHROUGH*/
+		case  3: k1 ^= tail[ 2] << 16;	/*FALLTHROUGH*/
+		case  2: k1 ^= tail[ 1] << 8;	/*FALLTHROUGH*/
 		case  1: k1 ^= tail[ 0] << 0;
 			k1 *= c1; k1 = hash_rotl_32(k1, 15); k1 *= c2; h1 ^= k1;
 		}



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:06:50 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: assert.h
ctl.h log.h ql.h qr.h rb.h rtree.h

Log Message:
add constcond


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/assert.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/ctl.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/log.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/ql.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/qr.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/rb.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/rtree.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/assert.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/assert.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/assert.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/assert.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/assert.h	Mon Mar  4 15:06:50 2019
@@ -13,7 +13,7 @@
 		__FILE__, __LINE__, #e);\
 		abort();		\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 #endif
 
 #ifndef not_reached
@@ -25,7 +25,7 @@
 		abort();		\
 	}\
 	unreachable();			\
-} while (0)
+} while (/*CONSTCOND*/0)
 #endif
 
 #ifndef not_implemented
@@ -35,7 +35,7 @@
 		__FILE__, __LINE__);\
 		abort();		\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 #endif
 
 #ifndef assert_not_implemented
@@ -43,7 +43,7 @@
 	if (unlikely(config_debug && !(e))) {\
 		not_implemented();	\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 #endif
 
 /* Use to assert a particular configuration, e.g., cassert(config_debug). */
@@ -52,5 +52,5 @@
 	if (unlikely(!(c))) {		\
 		not_reached();		\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 #endif
Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/ctl.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/ctl.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/ctl.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/ctl.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/ctl.h	Mon Mar  4 15:06:50 2019
@@ -109,7 +109,7 @@ void ctl_postfork_child(tsdn_t *tsdn);
 		name);		\
 		abort();		\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define xmallctlnametomib(name, mibp, miblenp) do {			\
 	if (je_mallctlnametomib(name, mibp, miblenp) != 0) {		\
@@ -117,7 +117,7 @@ void ctl_postfork_child(tsdn_t *tsdn);
 		"xmallctlnametomib(\"%s\", ...)\n", name);		\
 		abort();		\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define xmallctlbymib(mib, miblen, oldp, oldlenp, newp, newlen) do {	\
 	if (je_mallctlbymib(mib, miblen, oldp, oldlenp, newp,		\
@@ -126,6 +126,6 @@ void ctl_postfork_child(tsdn_t *tsdn);
 		": Failure in xmallctlbymib()\n");	\
 		abort();		\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #endif /* JEMALLOC_INTERNAL_CTL_H */
Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/log.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/log.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/log.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/log.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/log.h	Mon Mar  4 15:06:50 2019
@@ -110,6 +110,6 @@ do {	\
 	log_do_begin(log_var)		\
 		log_impl_varargs((log_var).name, __VA_ARGS__);		\
 	log_do_end(log_var)		\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #endif /* JEMALLOC_INTERNAL_LOG_H */
Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/ql.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/ql.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/ql.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/ql.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/ql.h	Mon Mar  4 15:06:50 2019
@@ -16,7 +16,7 @@ struct {\
 /* List functions. */
 #define ql_new(a_head) do {		\
 	(a_head)->qlh_first = NULL;	\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define ql_elm_new(a_elm, a_field) qr_new((a_elm), a_field)
 
@@ -39,7 +39,7 @@ struct {\
 	if (ql_first(a_head) == (a_qlelm)) {\
 		ql_first(a_head) = (a_elm);\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define ql_after_insert(a_qlelm, a_elm, a_field)			\
 	qr_after_insert((a_qlelm), (a_elm), a_field)
@@ -49,14 +49,14 @@ struct {\
 		

CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:06:31 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: ph.h

Log Message:
- fix shadowing
- add constcond


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.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/ph.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/ph.h	Mon Mar  4 15:06:31 2019
@@ -34,19 +34,19 @@ struct {\
 	(a_phn->a_field.phn_lchild)
 #define phn_lchild_set(a_type, a_field, a_phn, a_lchild) do {		\
 	a_phn->a_field.phn_lchild = a_lchild;\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define phn_next_get(a_type, a_field, a_phn)\
 	(a_phn->a_field.phn_next)
 #define phn_prev_set(a_type, a_field, a_phn, a_prev) do {		\
 	a_phn->a_field.phn_prev = a_prev;\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define phn_prev_get(a_type, a_field, a_phn)\
 	(a_phn->a_field.phn_prev)
 #define phn_next_set(a_type, a_field, a_phn, a_next) do {		\
 	a_phn->a_field.phn_next = a_next;\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define phn_merge_ordered(a_type, a_field, a_phn0, a_phn1, a_cmp) do {	\
 	a_type *phn0child;		\
@@ -62,7 +62,7 @@ struct {\
 		phn_prev_set(a_type, a_field, phn0child, a_phn1);	\
 	}\
 	phn_lchild_set(a_type, a_field, a_phn0, a_phn1);		\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define phn_merge(a_type, a_field, a_phn0, a_phn1, a_cmp, r_phn) do {	\
 	if (a_phn0 == NULL) {		\
@@ -78,7 +78,7 @@ struct {\
 		a_cmp);		\
 		r_phn = a_phn1;		\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define ph_merge_siblings(a_type, a_field, a_phn, a_cmp, r_phn) do {	\
 	a_type *head = NULL;		\
@@ -165,20 +165,20 @@ struct {\
 		}			\
 	}\
 	r_phn = phn0;			\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define ph_merge_aux(a_type, a_field, a_ph, a_cmp) do {			\
-	a_type *phn = phn_next_get(a_type, a_field, a_ph->ph_root);	\
-	if (phn != NULL) {		\
+	a_type *_phn = phn_next_get(a_type, a_field, a_ph->ph_root);	\
+	if (_phn != NULL) {		\
 		phn_prev_set(a_type, a_field, a_ph->ph_root, NULL);	\
 		phn_next_set(a_type, a_field, a_ph->ph_root, NULL);	\
-		phn_prev_set(a_type, a_field, phn, NULL);		\
-		ph_merge_siblings(a_type, a_field, phn, a_cmp, phn);	\
-		assert(phn_next_get(a_type, a_field, phn) == NULL);	\
-		phn_merge(a_type, a_field, a_ph->ph_root, phn, a_cmp,	\
+		phn_prev_set(a_type, a_field, _phn, NULL);		\
+		ph_merge_siblings(a_type, a_field, _phn, a_cmp, _phn);	\
+		assert(phn_next_get(a_type, a_field, _phn) == NULL);	\
+		phn_merge(a_type, a_field, a_ph->ph_root, _phn, a_cmp,	\
 		a_ph->ph_root);	\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define ph_merge_children(a_type, a_field, a_phn, a_cmp, r_phn) do {	\
 	a_type *lchild = phn_lchild_get(a_type, a_field, a_phn);	\
@@ -188,7 +188,7 @@ struct {\
 		ph_merge_siblings(a_type, a_field, lchild, a_cmp,	\
 		r_phn);		\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 /*
  * The ph_proto() macro generates function prototypes that correspond to the



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:06:11 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: mutex_prof.h

Log Message:
Adjust to new names


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex_prof.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/mutex_prof.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex_prof.h:1.2 src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex_prof.h:1.3
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex_prof.h:1.2	Mon Mar  4 12:23:37 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex_prof.h	Mon Mar  4 15:06:11 2019
@@ -96,17 +96,16 @@ typedef struct {
 	uint64_t		n_lock_ops;
 } mutex_prof_data_t;
 
-#define MUTEX_PROF_DATA_ZERO_INITIALIZER \
+#define MUTEX_PROF_DATA_INITIALIZER \
 	{ \
-		.tot_wait_time = NSTIME_ZERO_INITIALIZER, \
-		.max_wait_time = NSTIME_ZERO_INITIALIZER, \
+		.tot_wait_time = NSTIME_INITIALIZER, \
+		.max_wait_time = NSTIME_INITIALIZER, \
 		.n_wait_times = 0, \
 		.n_spin_acquired = 0, \
 		.max_n_thds = 0, \
-		.n_waiting_thds = 0, \
+		.n_waiting_thds = ATOMIC_INIT(0), \
 		.n_owner_switches = 0, \
 		.prev_owner = NULL, \
 		.n_lock_ops = 0, \
 	}
-
 #endif /* JEMALLOC_INTERNAL_MUTEX_PROF_H */



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:05:19 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: malloc_io.h

Log Message:
adjust prototype


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/malloc_io.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/malloc_io.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/malloc_io.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/malloc_io.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/malloc_io.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/malloc_io.h	Mon Mar  4 15:05:19 2019
@@ -41,7 +41,7 @@
 #define MALLOC_PRINTF_BUFSIZE	4096
 
 int buferror(int err, char *buf, size_t buflen);
-uintmax_t malloc_strtoumax(const char *restrict nptr, char **restrict endptr,
+uintmax_t malloc_strtoumax(const char *restrict nptr, const char **restrict endptr,
 int base);
 void malloc_write(const char *s);
 



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:05:01 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal:
jemalloc_internal_inlines_a.h

Log Message:
use UNCONST


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/external/bsd/jemalloc/dist/include/jemalloc/internal/jemalloc_internal_inlines_a.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/jemalloc_internal_inlines_a.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/jemalloc_internal_inlines_a.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/jemalloc_internal_inlines_a.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/jemalloc_internal_inlines_a.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/jemalloc_internal_inlines_a.h	Mon Mar  4 15:05:01 2019
@@ -89,7 +89,7 @@ arena_get(tsdn_t *tsdn, unsigned ind, bo
 	if (unlikely(ret == NULL)) {
 		if (init_if_missing) {
 			ret = arena_init(tsdn, ind,
-			(extent_hooks_t *)_hooks_default);
+			(extent_hooks_t *)__UNCONST(_hooks_default));
 		}
 	}
 	return ret;



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:04:43 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: hooks.h

Log Message:
fix prototypes


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/hooks.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/hooks.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/hooks.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/hooks.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/hooks.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/hooks.h	Mon Mar  4 15:04:43 2019
@@ -1,8 +1,8 @@
 #ifndef JEMALLOC_INTERNAL_HOOKS_H
 #define JEMALLOC_INTERNAL_HOOKS_H
 
-extern JEMALLOC_EXPORT void (*hooks_arena_new_hook)();
-extern JEMALLOC_EXPORT void (*hooks_libc_hook)();
+extern JEMALLOC_EXPORT void (*hooks_arena_new_hook)(void);
+extern JEMALLOC_EXPORT void (*hooks_libc_hook)(void);
 
 #define JEMALLOC_HOOK(fn, hook) ((void)(hook != NULL && (hook(), 0)), fn)
 



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:04:30 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal:
extent_externs.h

Log Message:
fix incorrect macro use


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/extent_externs.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/extent_externs.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/extent_externs.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/extent_externs.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/extent_externs.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/extent_externs.h	Mon Mar  4 15:04:30 2019
@@ -24,7 +24,7 @@ size_t extent_size_quantize_floor(size_t
 size_t extent_size_quantize_ceil(size_t size);
 #endif
 
-rb_proto(, extent_avail_, extent_tree_t, extent_t)
+ph_proto(, extent_avail_, extent_tree_t, extent_t)
 ph_proto(, extent_heap_, extent_heap_t, extent_t)
 
 bool extents_init(tsdn_t *tsdn, extents_t *extents, extent_state_t state,



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:04:09 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: hash.h

Log Message:
fix const hash


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/hash.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/hash.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/hash.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/hash.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/hash.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/hash.h	Mon Mar  4 15:04:09 2019
@@ -27,7 +27,7 @@ hash_get_block_32(const uint32_t *p, int
 	if (unlikely((uintptr_t)p & (sizeof(uint32_t)-1)) != 0) {
 		uint32_t ret;
 
-		memcpy(, (uint8_t *)(p + i), sizeof(uint32_t));
+		memcpy(, (const uint8_t *)(p + i), sizeof(uint32_t));
 		return ret;
 	}
 
@@ -40,7 +40,7 @@ hash_get_block_64(const uint64_t *p, int
 	if (unlikely((uintptr_t)p & (sizeof(uint64_t)-1)) != 0) {
 		uint64_t ret;
 
-		memcpy(, (uint8_t *)(p + i), sizeof(uint64_t));
+		memcpy(, (const uint8_t *)(p + i), sizeof(uint64_t));
 		return ret;
 	}
 



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:03:53 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: bit_util.h

Log Message:
remove unused line


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/bit_util.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/bit_util.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/bit_util.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/bit_util.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/bit_util.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/bit_util.h	Mon Mar  4 15:03:53 2019
@@ -58,7 +58,6 @@ ffs_u32(uint32_t bitmap) {
 #else
 #error No implementation for 32-bit ffs()
 #endif
-	return ffs_u(bitmap);
 }
 
 BIT_UTIL_INLINE uint64_t



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:03:00 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal:
prof_inlines_b.h

Log Message:
fix shadowing


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/prof_inlines_b.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/prof_inlines_b.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/prof_inlines_b.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/prof_inlines_b.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/prof_inlines_b.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/prof_inlines_b.h	Mon Mar  4 15:03:00 2019
@@ -99,14 +99,14 @@ prof_sample_accum_update(tsd_t *tsd, siz
 }
 
 JEMALLOC_ALWAYS_INLINE prof_tctx_t *
-prof_alloc_prep(tsd_t *tsd, size_t usize, bool prof_active, bool update) {
+prof_alloc_prep(tsd_t *tsd, size_t usize, bool _prof_active, bool update) {
 	prof_tctx_t *ret;
 	prof_tdata_t *tdata;
 	prof_bt_t bt;
 
 	assert(usize == sz_s2u(usize));
 
-	if (!prof_active || likely(prof_sample_accum_update(tsd, usize, update,
+	if (!_prof_active || likely(prof_sample_accum_update(tsd, usize, update,
 	))) {
 		ret = (prof_tctx_t *)(uintptr_t)1U;
 	} else {
@@ -135,14 +135,14 @@ prof_malloc(tsdn_t *tsdn, const void *pt
 
 JEMALLOC_ALWAYS_INLINE void
 prof_realloc(tsd_t *tsd, const void *ptr, size_t usize, prof_tctx_t *tctx,
-bool prof_active, bool updated, const void *old_ptr, size_t old_usize,
+bool _prof_active, bool updated, const void *old_ptr, size_t old_usize,
 prof_tctx_t *old_tctx) {
 	bool sampled, old_sampled, moved;
 
 	cassert(config_prof);
 	assert(ptr != NULL || (uintptr_t)tctx <= (uintptr_t)1U);
 
-	if (prof_active && !updated && ptr != NULL) {
+	if (_prof_active && !updated && ptr != NULL) {
 		assert(usize == isalloc(tsd_tsdn(tsd), ptr));
 		if (prof_sample_accum_update(tsd, usize, true, NULL)) {
 			/*



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:02:18 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: spin.h

Log Message:
fix prototype


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/spin.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/spin.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/spin.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/spin.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/spin.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/spin.h	Mon Mar  4 15:02:18 2019
@@ -8,7 +8,7 @@ typedef struct {
 } spin_t;
 
 static inline void
-spin_cpu_spinwait() {
+spin_cpu_spinwait(void) {
 #  if HAVE_CPU_SPINWAIT
 	CPU_SPINWAIT;
 #  else



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:01:59 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: witness.h

Log Message:
use c99 initializers


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
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/witness.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/witness.h	Mon Mar  4 15:01:59 2019
@@ -65,7 +65,13 @@
 /* PER-WITNESS DATA */
 /**/
 #if defined(JEMALLOC_DEBUG)
-#  define WITNESS_INITIALIZER(name, rank) {name, rank, NULL, NULL, {NULL, NULL}}
+#  define WITNESS_INITIALIZER(_name, _rank) { \
+	.name = _name, \
+	.rank = _rank, \
+	.comp = NULL, \
+	.opaque = NULL, \
+	.link = { .qre_prev = NULL, .qre_next = NULL }, \
+}
 #else
 #  define WITNESS_INITIALIZER(name, rank)
 #endif



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 20:01:42 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: emitter.h

Log Message:
use __format_arg__ to check format arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/emitter.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/emitter.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/emitter.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/emitter.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/emitter.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/emitter.h	Mon Mar  4 15:01:42 2019
@@ -115,10 +115,11 @@ emitter_table_printf(emitter_t *emitter,
 	}
 }
 
-static inline void
+static inline const char * __attribute__((__format_arg__(3)))
 emitter_gen_fmt(char *out_fmt, size_t out_size, const char *fmt_specifier,
 emitter_justify_t justify, int width) {
 	size_t written;
+	fmt_specifier++;
 	if (justify == emitter_justify_none) {
 		written = malloc_snprintf(out_fmt, out_size,
 		"%%%s", fmt_specifier);
@@ -131,6 +132,7 @@ emitter_gen_fmt(char *out_fmt, size_t ou
 	}
 	/* Only happens in case of bad format string, which *we* choose. */
 	assert(written <  out_size);
+	return out_fmt;
 }
 
 /*
@@ -156,26 +158,27 @@ emitter_print_value(emitter_t *emitter, 
 	char buf[BUF_SIZE];
 
 #define EMIT_SIMPLE(type, format)	\
-	emitter_gen_fmt(fmt, FMT_SIZE, format, justify, width);		\
-	emitter_printf(emitter, fmt, *(const type *)value);		\
+	emitter_printf(emitter,		\
+	emitter_gen_fmt(fmt, FMT_SIZE, format, justify, width),	\
+	*(const type *)value);
 
 	switch (value_type) {
 	case emitter_type_bool:
-		emitter_gen_fmt(fmt, FMT_SIZE, "s", justify, width);
-		emitter_printf(emitter, fmt, *(const bool *)value ?
-		"true" : "false");
+		emitter_printf(emitter, 
+		emitter_gen_fmt(fmt, FMT_SIZE, "%s", justify, width),
+		*(const bool *)value ?  "true" : "false");
 		break;
 	case emitter_type_int:
-		EMIT_SIMPLE(int, "d")
+		EMIT_SIMPLE(int, "%d")
 		break;
 	case emitter_type_unsigned:
-		EMIT_SIMPLE(unsigned, "u")
+		EMIT_SIMPLE(unsigned, "%u")
 		break;
 	case emitter_type_ssize:
-		EMIT_SIMPLE(ssize_t, "zd")
+		EMIT_SIMPLE(ssize_t, "%zd")
 		break;
 	case emitter_type_size:
-		EMIT_SIMPLE(size_t, "zu")
+		EMIT_SIMPLE(size_t, "%zu")
 		break;
 	case emitter_type_string:
 		str_written = malloc_snprintf(buf, BUF_SIZE, "\"%s\"",
@@ -185,17 +188,17 @@ emitter_print_value(emitter_t *emitter, 
 		 * anywhere near the fmt size.
 		 */
 		assert(str_written < BUF_SIZE);
-		emitter_gen_fmt(fmt, FMT_SIZE, "s", justify, width);
-		emitter_printf(emitter, fmt, buf);
+		emitter_printf(emitter, 
+		emitter_gen_fmt(fmt, FMT_SIZE, "%s", justify, width), buf);
 		break;
 	case emitter_type_uint32:
-		EMIT_SIMPLE(uint32_t, FMTu32)
+		EMIT_SIMPLE(uint32_t, "%" FMTu32)
 		break;
 	case emitter_type_uint64:
-		EMIT_SIMPLE(uint64_t, FMTu64)
+		EMIT_SIMPLE(uint64_t, "%" FMTu64)
 		break;
 	case emitter_type_title:
-		EMIT_SIMPLE(char *const, "s");
+		EMIT_SIMPLE(char *const, "%s");
 		break;
 	default:
 		unreachable();



CVS commit: src/external/bsd/jemalloc/lib

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 19:41:37 UTC 2019

Modified Files:
src/external/bsd/jemalloc/lib: Makefile

Log Message:
bump warns


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/jemalloc/lib/Makefile

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/lib/Makefile
diff -u src/external/bsd/jemalloc/lib/Makefile:1.1 src/external/bsd/jemalloc/lib/Makefile:1.2
--- src/external/bsd/jemalloc/lib/Makefile:1.1	Mon Mar  4 12:29:49 2019
+++ src/external/bsd/jemalloc/lib/Makefile	Mon Mar  4 14:41:37 2019
@@ -1,5 +1,6 @@
-# $NetBSD: Makefile,v 1.1 2019/03/04 17:29:49 christos Exp $
+# $NetBSD: Makefile,v 1.2 2019/03/04 19:41:37 christos Exp $
 
+WARNS?= 5
 .include 
 
 LIB=jemalloc



CVS commit: src/external/bsd/jemalloc/lib

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 19:41:51 UTC 2019

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
no need to elide format-non-literal


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/jemalloc/lib/Makefile.inc

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/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.1 src/external/bsd/jemalloc/lib/Makefile.inc:1.2
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.1	Mon Mar  4 12:29:24 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Mon Mar  4 14:41:51 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.1 2019/03/04 17:29:24 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.2 2019/03/04 19:41:51 christos Exp $
 
 JEMALLOC:=${.PARSEDIR}/../
 
@@ -42,7 +42,7 @@ COPTS.${i}+= -fvisibility=hidden -funrol
 
 COPTS.background_thread.c+=-Wno-error=stack-protector
 COPTS.ctl.c+=-Wno-error=stack-protector
-COPTS.stats.c+=-Wno-error=stack-protector -Wno-error=format-nonliteral
+COPTS.stats.c+=-Wno-error=stack-protector
 COPTS.tcache.c+=-Wno-error=stack-protector
 
 SRCS+=${JEMALLOC_SRCS}



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 19:40:57 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: emitter.h

Log Message:
use __format_arg__ to check arguments...


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/emitter.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/emitter.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/emitter.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/emitter.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/emitter.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/emitter.h	Mon Mar  4 14:40:57 2019
@@ -115,10 +115,11 @@ emitter_table_printf(emitter_t *emitter,
 	}
 }
 
-static inline void
+static inline const char * __attribute__((__format_arg__(3)))
 emitter_gen_fmt(char *out_fmt, size_t out_size, const char *fmt_specifier,
 emitter_justify_t justify, int width) {
 	size_t written;
+	fmt_specifier++;
 	if (justify == emitter_justify_none) {
 		written = malloc_snprintf(out_fmt, out_size,
 		"%%%s", fmt_specifier);
@@ -131,6 +132,7 @@ emitter_gen_fmt(char *out_fmt, size_t ou
 	}
 	/* Only happens in case of bad format string, which *we* choose. */
 	assert(written <  out_size);
+	return out_fmt;
 }
 
 /*
@@ -156,26 +158,27 @@ emitter_print_value(emitter_t *emitter, 
 	char buf[BUF_SIZE];
 
 #define EMIT_SIMPLE(type, format)	\
-	emitter_gen_fmt(fmt, FMT_SIZE, format, justify, width);		\
-	emitter_printf(emitter, fmt, *(const type *)value);		\
+	emitter_printf(emitter,		\
+	emitter_gen_fmt(fmt, FMT_SIZE, format, justify, width),	\
+	*(const type *)value);
 
 	switch (value_type) {
 	case emitter_type_bool:
-		emitter_gen_fmt(fmt, FMT_SIZE, "s", justify, width);
-		emitter_printf(emitter, fmt, *(const bool *)value ?
-		"true" : "false");
+		emitter_printf(emitter, 
+		emitter_gen_fmt(fmt, FMT_SIZE, "%s", justify, width),
+		*(const bool *)value ?  "true" : "false");
 		break;
 	case emitter_type_int:
-		EMIT_SIMPLE(int, "d")
+		EMIT_SIMPLE(int, "%d")
 		break;
 	case emitter_type_unsigned:
-		EMIT_SIMPLE(unsigned, "u")
+		EMIT_SIMPLE(unsigned, "%u")
 		break;
 	case emitter_type_ssize:
-		EMIT_SIMPLE(ssize_t, "zd")
+		EMIT_SIMPLE(ssize_t, "%zd")
 		break;
 	case emitter_type_size:
-		EMIT_SIMPLE(size_t, "zu")
+		EMIT_SIMPLE(size_t, "%zu")
 		break;
 	case emitter_type_string:
 		str_written = malloc_snprintf(buf, BUF_SIZE, "\"%s\"",
@@ -185,17 +188,17 @@ emitter_print_value(emitter_t *emitter, 
 		 * anywhere near the fmt size.
 		 */
 		assert(str_written < BUF_SIZE);
-		emitter_gen_fmt(fmt, FMT_SIZE, "s", justify, width);
-		emitter_printf(emitter, fmt, buf);
+		emitter_printf(emitter, 
+		emitter_gen_fmt(fmt, FMT_SIZE, "%s", justify, width), buf);
 		break;
 	case emitter_type_uint32:
-		EMIT_SIMPLE(uint32_t, FMTu32)
+		EMIT_SIMPLE(uint32_t, "%" FMTu32)
 		break;
 	case emitter_type_uint64:
-		EMIT_SIMPLE(uint64_t, FMTu64)
+		EMIT_SIMPLE(uint64_t, "%" FMTu64)
 		break;
 	case emitter_type_title:
-		EMIT_SIMPLE(char *const, "s");
+		EMIT_SIMPLE(char *const, "%s");
 		break;
 	default:
 		unreachable();



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 19:16:31 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: mutex.h

Log Message:
Put back braces.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/mutex.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.1 src/external/bsd/jemalloc/include/jemalloc/internal/mutex.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/mutex.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/mutex.h	Mon Mar  4 14:16:31 2019
@@ -110,10 +110,10 @@ struct malloc_mutex_s {
   WITNESS_INITIALIZER("mutex", WITNESS_RANK_OMIT)}
 #else
 #define MALLOC_MUTEX_TYPE PTHREAD_MUTEX_DEFAULT
-#define MALLOC_MUTEX_INITIALIZER {{ \
+#define MALLOC_MUTEX_INITIALIZER {{{ \
 	.prof_data = MUTEX_PROF_DATA_INITIALIZER, \
 	.lock = PTHREAD_MUTEX_INITIALIZER, \
-	},	\
+	}},	\
 WITNESS_INITIALIZER("mutex", WITNESS_RANK_OMIT)}
 #endif
 



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 19:16:10 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: mutex_prof.h

Log Message:
use ATOMIC_INIT()


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/mutex_prof.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_prof.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/mutex_prof.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/mutex_prof.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/mutex_prof.h:1.1	Mon Mar  4 12:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/mutex_prof.h	Mon Mar  4 14:16:10 2019
@@ -103,7 +103,7 @@ typedef struct {
 		.n_wait_times = 0, \
 		.n_spin_acquired = 0, \
 		.max_n_thds = 0, \
-		.n_waiting_thds = 0, \
+		.n_waiting_thds = ATOMIC_INIT(0), \
 		.n_owner_switches = 0, \
 		.prev_owner = NULL, \
 		.n_lock_ops = 0, \



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 19:15:39 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: base.c

Log Message:
put back __UNCONST for now.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/dist/src/base.c

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/src/base.c
diff -u src/external/bsd/jemalloc/dist/src/base.c:1.2 src/external/bsd/jemalloc/dist/src/base.c:1.3
--- src/external/bsd/jemalloc/dist/src/base.c:1.2	Mon Mar  4 12:19:45 2019
+++ src/external/bsd/jemalloc/dist/src/base.c	Mon Mar  4 14:15:39 2019
@@ -509,6 +509,7 @@ base_postfork_child(tsdn_t *tsdn, base_t
 
 bool
 base_boot(tsdn_t *tsdn) {
-	b0 = base_new(tsdn, 0, (extent_hooks_t *)__UNCONST(_hooks_default));
+	b0 = base_new(tsdn, 0, (extent_hooks_t *)
+	__UNCONST(_hooks_default));
 	return (b0 == NULL);
 }



CVS commit: src/external/bsd/jemalloc/lib

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:26:52 UTC 2019

Added Files:
src/external/bsd/jemalloc/lib: divide.c

Log Message:
We already have div.{c,S} in libc so we call this one divide.c


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/jemalloc/lib/divide.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/external/bsd/jemalloc/lib/divide.c
diff -u /dev/null src/external/bsd/jemalloc/lib/divide.c:1.1
--- /dev/null	Mon Mar  4 12:26:52 2019
+++ src/external/bsd/jemalloc/lib/divide.c	Mon Mar  4 12:26:51 2019
@@ -0,0 +1 @@
+#include "../dist/src/div.c"



CVS commit: src/external/bsd/jemalloc/lib

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:29:24 UTC 2019

Added Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
Add glue for libc.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/jemalloc/lib/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u /dev/null src/external/bsd/jemalloc/lib/Makefile.inc:1.1
--- /dev/null	Mon Mar  4 12:29:24 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Mon Mar  4 12:29:24 2019
@@ -0,0 +1,51 @@
+#	$NetBSD: Makefile.inc,v 1.1 2019/03/04 17:29:24 christos Exp $
+
+JEMALLOC:=${.PARSEDIR}/../
+
+JEMALLOC_SRCS+= \
+jemalloc.c \
+arena.c \
+background_thread.c \
+base.c \
+bin.c \
+bitmap.c \
+ckh.c \
+ctl.c \
+divide.c \
+extent.c \
+extent_dss.c \
+extent_mmap.c \
+hash.c \
+hooks.c \
+large.c \
+log.c \
+malloc_io.c \
+mutex.c \
+mutex_pool.c \
+nstime.c \
+pages.c \
+prng.c \
+prof.c \
+rtree.c \
+stats.c \
+sz.c \
+tcache.c \
+ticker.c \
+tsd.c \
+witness.c
+
+.PATH: ${JEMALLOC}/dist/src ${JEMALLOC}/lib
+.for i in ${JEMALLOC_SRCS}
+CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_NO_PRIVATE_NAMESPACE
+COPTS.${i}+= -fvisibility=hidden -funroll-loops 
+.endfor
+
+COPTS.background_thread.c+=-Wno-error=stack-protector
+COPTS.ctl.c+=-Wno-error=stack-protector
+COPTS.stats.c+=-Wno-error=stack-protector -Wno-error=format-nonliteral
+COPTS.tcache.c+=-Wno-error=stack-protector
+
+SRCS+=${JEMALLOC_SRCS}
+
+jemalloc.d jemalloc.pico jemalloc.o jemalloc.ln jemalloc.po jemalloc.go: \
+${JEMALLOC}/dist/src/jemalloc.c



CVS commit: src/external/bsd/jemalloc/lib

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:29:49 UTC 2019

Added Files:
src/external/bsd/jemalloc/lib: Makefile shlib_version

Log Message:
Add Makefiles if we want to build jemalloc standalone.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/jemalloc/lib/Makefile \
src/external/bsd/jemalloc/lib/shlib_version

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/external/bsd/jemalloc/lib/Makefile
diff -u /dev/null src/external/bsd/jemalloc/lib/Makefile:1.1
--- /dev/null	Mon Mar  4 12:29:49 2019
+++ src/external/bsd/jemalloc/lib/Makefile	Mon Mar  4 12:29:49 2019
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2019/03/04 17:29:49 christos Exp $
+
+.include 
+
+LIB=jemalloc
+
+.include "Makefile.inc"
+
+.include 
Index: src/external/bsd/jemalloc/lib/shlib_version
diff -u /dev/null src/external/bsd/jemalloc/lib/shlib_version:1.1
--- /dev/null	Mon Mar  4 12:29:49 2019
+++ src/external/bsd/jemalloc/lib/shlib_version	Mon Mar  4 12:29:49 2019
@@ -0,0 +1,3 @@
+#	$NetBSD: shlib_version,v 1.1 2019/03/04 17:29:49 christos Exp $
+major=0
+minor=0



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:24:03 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: mutex.h

Log Message:
use c99 initializers


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.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/mutex.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex.h	Mon Mar  4 12:24:02 2019
@@ -94,28 +94,27 @@ struct malloc_mutex_s {
 #define MALLOC_MUTEX_TRYLOCK(m) (pthread_mutex_trylock(&(m)->lock) != 0)
 #endif
 
-#define LOCK_PROF_DATA_INITIALIZER	\
-{NSTIME_ZERO_INITIALIZER, NSTIME_ZERO_INITIALIZER, 0, 0, 0,		\
-	ATOMIC_INIT(0), 0, NULL, 0}
-
 #ifdef _WIN32
 #  define MALLOC_MUTEX_INITIALIZER
 #elif (defined(JEMALLOC_OS_UNFAIR_LOCK))
 #  define MALLOC_MUTEX_INITIALIZER	\
- {{{LOCK_PROF_DATA_INITIALIZER, OS_UNFAIR_LOCK_INIT}},		\
+ {{{MUTEX_PROF_DATA_INITIALIZER, OS_UNFAIR_LOCK_INIT}},		\
   WITNESS_INITIALIZER("mutex", WITNESS_RANK_OMIT)}
 #elif (defined(JEMALLOC_OSSPIN))
 #  define MALLOC_MUTEX_INITIALIZER	\
- {{{LOCK_PROF_DATA_INITIALIZER, 0}},\
+ {{{MUTEX_PROF_DATA_INITIALIZER, 0}},\
   WITNESS_INITIALIZER("mutex", WITNESS_RANK_OMIT)}
 #elif (defined(JEMALLOC_MUTEX_INIT_CB))
 #  define MALLOC_MUTEX_INITIALIZER	\
- {{{LOCK_PROF_DATA_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, NULL}},	\
+ {{{MUTEX_PROF_DATA_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, NULL}},	\
   WITNESS_INITIALIZER("mutex", WITNESS_RANK_OMIT)}
 #else
 #define MALLOC_MUTEX_TYPE PTHREAD_MUTEX_DEFAULT
 #define MALLOC_MUTEX_INITIALIZER	\
-   {{{LOCK_PROF_DATA_INITIALIZER, PTHREAD_MUTEX_INITIALIZER}},	\
+   {{{
+   .prof_data = MUTEX_PROF_DATA_INITIALIZER, 
+   .lock = PTHREAD_MUTEX_INITIALIZER,
+   }},	\
 WITNESS_INITIALIZER("mutex", WITNESS_RANK_OMIT)}
 #endif
 



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:23:37 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: mutex_prof.h

Log Message:
Add a c99 initializer


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex_prof.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/mutex_prof.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex_prof.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex_prof.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex_prof.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/mutex_prof.h	Mon Mar  4 12:23:37 2019
@@ -96,4 +96,17 @@ typedef struct {
 	uint64_t		n_lock_ops;
 } mutex_prof_data_t;
 
+#define MUTEX_PROF_DATA_ZERO_INITIALIZER \
+	{ \
+		.tot_wait_time = NSTIME_ZERO_INITIALIZER, \
+		.max_wait_time = NSTIME_ZERO_INITIALIZER, \
+		.n_wait_times = 0, \
+		.n_spin_acquired = 0, \
+		.max_n_thds = 0, \
+		.n_waiting_thds = 0, \
+		.n_owner_switches = 0, \
+		.prev_owner = NULL, \
+		.n_lock_ops = 0, \
+	}
+
 #endif /* JEMALLOC_INTERNAL_MUTEX_PROF_H */



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:23:10 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal: nstime.h

Log Message:
use c99 initializers


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.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/nstime.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/nstime.h	Mon Mar  4 12:23:10 2019
@@ -3,12 +3,13 @@
 
 /* Maximum supported number of seconds (~584 years). */
 #define NSTIME_SEC_MAX KQU(18446744072)
-#define NSTIME_ZERO_INITIALIZER {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);



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:21:31 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: ckh.c ctl.c

Log Message:
- add unconst
- fixes for shadowing


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/ckh.c \
src/external/bsd/jemalloc/dist/src/ctl.c

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/src/ckh.c
diff -u src/external/bsd/jemalloc/dist/src/ckh.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/ckh.c:1.2
--- src/external/bsd/jemalloc/dist/src/ckh.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/ckh.c	Mon Mar  4 12:21:31 2019
@@ -356,14 +356,14 @@ ckh_shrink(tsd_t *tsd, ckh_t *ckh) {
 }
 
 bool
-ckh_new(tsd_t *tsd, ckh_t *ckh, size_t minitems, ckh_hash_t *hash,
+ckh_new(tsd_t *tsd, ckh_t *ckh, size_t minitems, ckh_hash_t *hashp,
 ckh_keycomp_t *keycomp) {
 	bool ret;
 	size_t mincells, usize;
 	unsigned lg_mincells;
 
 	assert(minitems > 0);
-	assert(hash != NULL);
+	assert(hashp != NULL);
 	assert(keycomp != NULL);
 
 #ifdef CKH_COUNT
@@ -392,7 +392,7 @@ ckh_new(tsd_t *tsd, ckh_t *ckh, size_t m
 	}
 	ckh->lg_minbuckets = lg_mincells - LG_CKH_BUCKET_CELLS;
 	ckh->lg_curbuckets = lg_mincells - LG_CKH_BUCKET_CELLS;
-	ckh->hash = hash;
+	ckh->hash = hashp;
 	ckh->keycomp = keycomp;
 
 	usize = sz_sa2u(sizeof(ckhc_t) << lg_mincells, CACHELINE);
@@ -449,10 +449,10 @@ ckh_iter(ckh_t *ckh, size_t *tabind, voi
 	LG_CKH_BUCKET_CELLS)); i < ncells; i++) {
 		if (ckh->tab[i].key != NULL) {
 			if (key != NULL) {
-*key = (void *)ckh->tab[i].key;
+*key = (void *)__UNCONST(ckh->tab[i].key);
 			}
 			if (data != NULL) {
-*data = (void *)ckh->tab[i].data;
+*data = (void *)__UNCONST(ckh->tab[i].data);
 			}
 			*tabind = i + 1;
 			return false;
@@ -495,10 +495,10 @@ ckh_remove(tsd_t *tsd, ckh_t *ckh, const
 	cell = ckh_isearch(ckh, searchkey);
 	if (cell != SIZE_T_MAX) {
 		if (key != NULL) {
-			*key = (void *)ckh->tab[cell].key;
+			*key = (void *)__UNCONST(ckh->tab[cell].key);
 		}
 		if (data != NULL) {
-			*data = (void *)ckh->tab[cell].data;
+			*data = (void *)__UNCONST(ckh->tab[cell].data);
 		}
 		ckh->tab[cell].key = NULL;
 		ckh->tab[cell].data = NULL; /* Not necessary. */
@@ -527,10 +527,10 @@ ckh_search(ckh_t *ckh, const void *searc
 	cell = ckh_isearch(ckh, searchkey);
 	if (cell != SIZE_T_MAX) {
 		if (key != NULL) {
-			*key = (void *)ckh->tab[cell].key;
+			*key = (void *)__UNCONST(ckh->tab[cell].key);
 		}
 		if (data != NULL) {
-			*data = (void *)ckh->tab[cell].data;
+			*data = (void *)__UNCONST(ckh->tab[cell].data);
 		}
 		return false;
 	}
@@ -548,7 +548,7 @@ ckh_string_keycomp(const void *k1, const
 	assert(k1 != NULL);
 	assert(k2 != NULL);
 
-	return !strcmp((char *)k1, (char *)k2);
+	return !strcmp((const char *)k1, (const char *)k2);
 }
 
 void
Index: src/external/bsd/jemalloc/dist/src/ctl.c
diff -u src/external/bsd/jemalloc/dist/src/ctl.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/ctl.c:1.2
--- src/external/bsd/jemalloc/dist/src/ctl.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/ctl.c	Mon Mar  4 12:21:31 2019
@@ -234,7 +234,7 @@ CTL_PROTO(stats_mutexes_reset)
 #define NAME(n)	{true},	n
 #define CHILD(t, c)			\
 	sizeof(c##_node) / sizeof(ctl_##t##_node_t),			\
-	(ctl_node_t *)c##_node,		\
+	(const ctl_node_t *)c##_node,	\
 	NULL
 #define CTL(c)	0, NULL, c##_ctl
 
@@ -1299,14 +1299,14 @@ ctl_postfork_child(tsdn_t *tsdn) {
 		ret = EPERM;		\
 		goto label_return;	\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define WRITEONLY()	do {		\
 	if (oldp != NULL || oldlenp != NULL) {\
 		ret = EPERM;		\
 		goto label_return;	\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define READ_XOR_WRITE()	do {	\
 	if ((oldp != NULL && oldlenp != NULL) && (newp != NULL ||	\
@@ -1314,7 +1314,7 @@ ctl_postfork_child(tsdn_t *tsdn) {
 		ret = EPERM;		\
 		goto label_return;	\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define READ(v, t)	do {		\
 	if (oldp != NULL && oldlenp != NULL) {\
@@ -1327,7 +1327,7 @@ ctl_postfork_child(tsdn_t *tsdn) {
 		}			\
 		*(t *)oldp = (v);	\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define WRITE(v, t)	do {		\
 	if (newp != NULL) {		\
@@ -1337,7 +1337,7 @@ ctl_postfork_child(tsdn_t *tsdn) {
 		}			\
 		(v) = *(t *)newp;	\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #define MIB_UNSIGNED(v, i) do {		\
 	if (mib[i] > UINT_MAX) {	\
@@ -1345,7 +1345,7 @@ ctl_postfork_child(tsdn_t *tsdn) {
 		goto label_return;	\
 	}\
 	v = (unsigned)mib[i];		\
-} while (0)
+} while (/*CONSTCOND*/0)
 
 /*
  * There's a lot of code duplication in the following macros due to limitations
@@ -2262,7 +2262,7 @@ arena_i_extent_hooks_ctl(tsd_t 

CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:20:07 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: extent.c

Log Message:
fix for shadowing.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/extent.c

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/src/extent.c
diff -u src/external/bsd/jemalloc/dist/src/extent.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/extent.c:1.2
--- src/external/bsd/jemalloc/dist/src/extent.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/extent.c	Mon Mar  4 12:20:07 2019
@@ -1113,14 +1113,14 @@ extent_recycle(tsdn_t *tsdn, arena_t *ar
 
 	if (*zero) {
 		void *addr = extent_base_get(extent);
-		size_t size = extent_size_get(extent);
+		size_t sz = extent_size_get(extent);
 		if (!extent_zeroed_get(extent)) {
-			if (pages_purge_forced(addr, size)) {
-memset(addr, 0, size);
+			if (pages_purge_forced(addr, sz)) {
+memset(addr, 0, sz);
 			}
 		} else if (config_debug) {
 			size_t *p = (size_t *)(uintptr_t)addr;
-			for (size_t i = 0; i < size / sizeof(size_t); i++) {
+			for (size_t i = 0; i < sz / sizeof(size_t); i++) {
 assert(p[i] == 0);
 			}
 		}
@@ -1365,18 +1365,18 @@ extent_grow_retained(tsdn_t *tsdn, arena
 		extent_addr_randomize(tsdn, extent, alignment);
 	}
 	if (slab) {
-		rtree_ctx_t rtree_ctx_fallback;
-		rtree_ctx_t *rtree_ctx = tsdn_rtree_ctx(tsdn,
-		_ctx_fallback);
+		rtree_ctx_t rtree_ctx_fallback1;
+		rtree_ctx_t *rtree_ctx1 = tsdn_rtree_ctx(tsdn,
+		_ctx_fallback1);
 
 		extent_slab_set(extent, true);
-		extent_interior_register(tsdn, rtree_ctx, extent, szind);
+		extent_interior_register(tsdn, rtree_ctx1, extent, szind);
 	}
 	if (*zero && !extent_zeroed_get(extent)) {
 		void *addr = extent_base_get(extent);
-		size_t size = extent_size_get(extent);
-		if (pages_purge_forced(addr, size)) {
-			memset(addr, 0, size);
+		size_t sz = extent_size_get(extent);
+		if (pages_purge_forced(addr, sz)) {
+			memset(addr, 0, sz);
 		}
 	}
 



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:19:45 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: base.c

Log Message:
add __UNCONST


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/base.c

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/src/base.c
diff -u src/external/bsd/jemalloc/dist/src/base.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/base.c:1.2
--- src/external/bsd/jemalloc/dist/src/base.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/base.c	Mon Mar  4 12:19:45 2019
@@ -509,6 +509,6 @@ base_postfork_child(tsdn_t *tsdn, base_t
 
 bool
 base_boot(tsdn_t *tsdn) {
-	b0 = base_new(tsdn, 0, (extent_hooks_t *)_hooks_default);
+	b0 = base_new(tsdn, 0, (extent_hooks_t *)__UNCONST(_hooks_default));
 	return (b0 == NULL);
 }



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:18:53 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: prof.c

Log Message:
- add UNCONST
- fix for shadowing


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/prof.c

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/src/prof.c
diff -u src/external/bsd/jemalloc/dist/src/prof.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/prof.c:1.2
--- src/external/bsd/jemalloc/dist/src/prof.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/prof.c	Mon Mar  4 12:18:53 2019
@@ -1267,7 +1267,7 @@ struct prof_tdata_merge_iter_arg_s {
 };
 
 static prof_tdata_t *
-prof_tdata_merge_iter(prof_tdata_tree_t *tdatas, prof_tdata_t *tdata,
+prof_tdata_merge_iter(prof_tdata_tree_t *tdatasunused, prof_tdata_t *tdata,
 void *opaque) {
 	struct prof_tdata_merge_iter_arg_s *arg =
 	(struct prof_tdata_merge_iter_arg_s *)opaque;
@@ -1302,7 +1302,7 @@ prof_tdata_merge_iter(prof_tdata_tree_t 
 }
 
 static prof_tdata_t *
-prof_tdata_dump_iter(prof_tdata_tree_t *tdatas, prof_tdata_t *tdata,
+prof_tdata_dump_iter(prof_tdata_tree_t *tdatasunused, prof_tdata_t *tdata,
 void *arg) {
 	bool propagate_err = *(bool *)arg;
 
@@ -1867,7 +1867,7 @@ prof_gdump(tsdn_t *tsdn) {
 
 static void
 prof_bt_hash(const void *key, size_t r_hash[2]) {
-	prof_bt_t *bt = (prof_bt_t *)key;
+	const prof_bt_t *bt = (const prof_bt_t *)key;
 
 	cassert(config_prof);
 
@@ -1876,8 +1876,8 @@ prof_bt_hash(const void *key, size_t r_h
 
 static bool
 prof_bt_keycomp(const void *k1, const void *k2) {
-	const prof_bt_t *bt1 = (prof_bt_t *)k1;
-	const prof_bt_t *bt2 = (prof_bt_t *)k2;
+	const prof_bt_t *bt1 = (const prof_bt_t *)k1;
+	const prof_bt_t *bt2 = (const prof_bt_t *)k2;
 
 	cassert(config_prof);
 
@@ -2050,7 +2050,7 @@ prof_tdata_expire(tsdn_t *tsdn, prof_tda
 }
 
 static prof_tdata_t *
-prof_tdata_reset_iter(prof_tdata_tree_t *tdatas, prof_tdata_t *tdata,
+prof_tdata_reset_iter(prof_tdata_tree_t *tdatasunused, prof_tdata_t *tdata,
 void *arg) {
 	tsdn_t *tsdn = (tsdn_t *)arg;
 
@@ -2141,7 +2141,7 @@ prof_thread_name_alloc(tsdn_t *tsdn, con
 
 	size = strlen(thread_name) + 1;
 	if (size == 1) {
-		return "";
+		return __UNCONST(""); // XXX
 	}
 
 	ret = iallocztm(tsdn, size, sz_size2index(size), false, NULL, true,
@@ -2170,7 +2170,7 @@ prof_thread_name_set(tsd_t *tsd, const c
 	}
 	for (i = 0; thread_name[i] != '\0'; i++) {
 		char c = thread_name[i];
-		if (!isgraph(c) && !isblank(c)) {
+		if (!isgraph((unsigned char)c) && !isblank((unsigned char)c)) {
 			return EFAULT;
 		}
 	}



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:19:14 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: hooks.c

Log Message:
fix prototypes


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/hooks.c

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/src/hooks.c
diff -u src/external/bsd/jemalloc/dist/src/hooks.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/hooks.c:1.2
--- src/external/bsd/jemalloc/dist/src/hooks.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/hooks.c	Mon Mar  4 12:19:14 2019
@@ -6,7 +6,7 @@
  * from outside the generated library, so that we can use them in test code.
  */
 JEMALLOC_EXPORT
-void (*hooks_arena_new_hook)() = NULL;
+void (*hooks_arena_new_hook)(void) = NULL;
 
 JEMALLOC_EXPORT
-void (*hooks_libc_hook)() = NULL;
+void (*hooks_libc_hook)(void) = NULL;



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:18:27 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: jemalloc.c

Log Message:
- fix for shadowing
- add unconst
- add hack for broken lint
- add cast for ctype macros
- disable realloc(ptr, 0) returning NULL for non-NULL ptr (compatibility)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/jemalloc.c

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/src/jemalloc.c
diff -u src/external/bsd/jemalloc/dist/src/jemalloc.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/jemalloc.c:1.2
--- src/external/bsd/jemalloc/dist/src/jemalloc.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/jemalloc.c	Mon Mar  4 12:18:27 2019
@@ -157,7 +157,12 @@ static const void (WINAPI *init_init_loc
 #endif
 #endif
 #else
+#ifndef __lint__
+// Broken lint
 static malloc_mutex_t	init_lock = MALLOC_MUTEX_INITIALIZER;
+#else
+static malloc_mutex_t	init_lock;
+#endif
 #endif
 
 typedef struct {
@@ -562,8 +567,8 @@ arena_choose_hard(tsd_t *tsd, bool inter
 /* Initialize a new arena. */
 choose[j] = first_null;
 arena = arena_init_locked(tsd_tsdn(tsd),
-choose[j],
-(extent_hooks_t *)_hooks_default);
+choose[j], (extent_hooks_t *)
+__UNCONST(_hooks_default));
 if (arena == NULL) {
 	malloc_mutex_unlock(tsd_tsdn(tsd),
 	_lock);
@@ -974,7 +979,7 @@ malloc_conf_init(void) {
 #define CONF_HANDLE_T_U(t, o, n, min, max, check_min, check_max, clip)	\
 			if (CONF_MATCH(n)) {\
 uintmax_t um;\
-char *end;\
+const char *end;			\
 	\
 set_errno(0);\
 um = malloc_strtoumax(v, , 0);	\
@@ -1051,12 +1056,12 @@ malloc_conf_init(void) {
 			CONF_HANDLE_BOOL(opt_abort, "abort")
 			CONF_HANDLE_BOOL(opt_abort_conf, "abort_conf")
 			if (strncmp("metadata_thp", k, klen) == 0) {
-int i;
+int ii;
 bool match = false;
-for (i = 0; i < metadata_thp_mode_limit; i++) {
-	if (strncmp(metadata_thp_mode_names[i],
+for (ii = 0; ii < metadata_thp_mode_limit; ii++) {
+	if (strncmp(metadata_thp_mode_names[ii],
 	v, vlen) == 0) {
-		opt_metadata_thp = i;
+		opt_metadata_thp = ii;
 		match = true;
 		break;
 	}
@@ -1069,18 +1074,18 @@ malloc_conf_init(void) {
 			}
 			CONF_HANDLE_BOOL(opt_retain, "retain")
 			if (strncmp("dss", k, klen) == 0) {
-int i;
+int ii;
 bool match = false;
-for (i = 0; i < dss_prec_limit; i++) {
-	if (strncmp(dss_prec_names[i], v, vlen)
+for (ii = 0; ii < dss_prec_limit; ii++) {
+	if (strncmp(dss_prec_names[ii], v, vlen)
 	== 0) {
-		if (extent_dss_prec_set(i)) {
+		if (extent_dss_prec_set(ii)) {
 			malloc_conf_error(
 			"Error setting dss",
 			k, klen, v, vlen);
 		} else {
 			opt_dss =
-			dss_prec_names[i];
+			dss_prec_names[ii];
 			match = true;
 			break;
 		}
@@ -1143,21 +1148,21 @@ malloc_conf_init(void) {
 			CONF_HANDLE_BOOL(opt_tcache, "tcache")
 			CONF_HANDLE_SIZE_T(opt_lg_extent_max_active_fit,
 			"lg_extent_max_active_fit", 0,
-			(sizeof(size_t) << 3), yes, yes, false)
+			(sizeof(size_t) << 3), no, yes, false)
 			CONF_HANDLE_SSIZE_T(opt_lg_tcache_max, "lg_tcache_max",
 			-1, (sizeof(size_t) << 3) - 1)
 			if (strncmp("percpu_arena", k, klen) == 0) {
 bool match = false;
-for (int i = percpu_arena_mode_names_base; i <
-percpu_arena_mode_names_limit; i++) {
-	if (strncmp(percpu_arena_mode_names[i],
+for (int ii = percpu_arena_mode_names_base; ii <
+percpu_arena_mode_names_limit; ii++) {
+	if (strncmp(percpu_arena_mode_names[ii],
 	v, vlen) == 0) {
 		if (!have_percpu_arena) {
 			malloc_conf_error(
 			"No getcpu support",
 			k, klen, v, vlen);
 		}
-		opt_percpu_arena = i;
+		opt_percpu_arena = ii;
 		match = true;
 		break;
 	}
@@ -1204,15 +1209,15 @@ malloc_conf_init(void) {
 			}
 			if (CONF_MATCH("thp")) {
 bool match = false;
-for (int i = 0; i < thp_mode_names_limit; i++) {
-	if (strncmp(thp_mode_names[i],v, vlen)
+for (int ii = 0; ii < thp_mode_names_limit; ii++) {
+	if (strncmp(thp_mode_names[ii],v, vlen)
 	== 0) {
 		if (!have_madvise_huge) {
 			malloc_conf_error(
 			"No THP support",
 			k, klen, v, vlen);
 		}
-		opt_thp = i;
+		opt_thp = ii;
 		match = true;
 		break;
 	}
@@ -1272,7 +1277,7 @@ malloc_init_hard_needed(void) {
 }
 
 static bool
-malloc_init_hard_a0_locked() {
+malloc_init_hard_a0_locked(void) {
 	malloc_initializer = INITIALIZER;
 
 	if (config_prof) {
@@ -1321,7 +1326,7 @@ malloc_init_hard_a0_locked() {
 	 * Initialize one arena here.  The rest are lazily created in
 	 * 

CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:16:47 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: mutex.c

Log Message:
rename initializer for consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/mutex.c

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/src/mutex.c
diff -u src/external/bsd/jemalloc/dist/src/mutex.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/mutex.c:1.2
--- src/external/bsd/jemalloc/dist/src/mutex.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/mutex.c	Mon Mar  4 12:16:46 2019
@@ -46,7 +46,7 @@ JEMALLOC_EXPORT int	_pthread_mutex_init_
 void
 malloc_mutex_lock_slow(malloc_mutex_t *mutex) {
 	mutex_prof_data_t *data = >prof_data;
-	UNUSED nstime_t before = NSTIME_ZERO_INITIALIZER;
+	UNUSED nstime_t before = NSTIME_INITIALIZER;
 
 	if (ncpus == 1) {
 		goto label_spin_done;



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:16:27 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: malloc_io.c

Log Message:
remove needless casts after fixing prototype.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/malloc_io.c

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/src/malloc_io.c
diff -u src/external/bsd/jemalloc/dist/src/malloc_io.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/malloc_io.c:1.2
--- src/external/bsd/jemalloc/dist/src/malloc_io.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/malloc_io.c	Mon Mar  4 12:16:27 2019
@@ -111,7 +111,7 @@ buferror(int err, char *buf, size_t bufl
 }
 
 uintmax_t
-malloc_strtoumax(const char *restrict nptr, char **restrict endptr, int base) {
+malloc_strtoumax(const char *restrict nptr, const char **restrict endptr, int base) {
 	uintmax_t ret, digit;
 	unsigned b;
 	bool neg;
@@ -223,9 +223,9 @@ label_return:
 	if (endptr != NULL) {
 		if (p == ns) {
 			/* No characters were converted. */
-			*endptr = (char *)nptr;
+			*endptr = nptr;
 		} else {
-			*endptr = (char *)p;
+			*endptr = p;
 		}
 	}
 	return ret;
@@ -460,7 +460,7 @@ malloc_vsnprintf(char *str, size_t size,
 			case '5': case '6': case '7': case '8': case '9': {
 uintmax_t uwidth;
 set_errno(0);
-uwidth = malloc_strtoumax(f, (char **), 10);
+uwidth = malloc_strtoumax(f, , 10);
 assert(uwidth != UINTMAX_MAX || get_errno() !=
 ERANGE);
 width = (int)uwidth;
@@ -484,7 +484,7 @@ malloc_vsnprintf(char *str, size_t size,
 			case '5': case '6': case '7': case '8': case '9': {
 uintmax_t uprec;
 set_errno(0);
-uprec = malloc_strtoumax(f, (char **), 10);
+uprec = malloc_strtoumax(f, , 10);
 assert(uprec != UINTMAX_MAX || get_errno() !=
 ERANGE);
 prec = (int)uprec;



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  4 17:15:37 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: stats.c

Log Message:
rename for shadowing


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/stats.c

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/src/stats.c
diff -u src/external/bsd/jemalloc/dist/src/stats.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/stats.c:1.2
--- src/external/bsd/jemalloc/dist/src/stats.c:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/stats.c	Mon Mar  4 12:15:37 2019
@@ -1008,10 +1008,10 @@ stats_general_print(emitter_t *emitter) 
 	emitter_kv(emitter, "nbins", "Number of bin size classes",
 	emitter_type_unsigned, );
 
-	unsigned nhbins;
-	CTL_GET("arenas.nhbins", , unsigned);
+	unsigned nh_bins;
+	CTL_GET("arenas.nhbins", _bins, unsigned);
 	emitter_kv(emitter, "nhbins", "Number of thread-cache bin size classes",
-	emitter_type_unsigned, );
+	emitter_type_unsigned, _bins);
 
 	/*
 	 * We do enough mallctls in a loop that we actually want to omit them