Module Name:    src
Committed By:   rin
Date:           Wed Apr 22 08:45:06 UTC 2020

Modified Files:
        src/lib/libc/stdlib: jemalloc.c

Log Message:
Fix previous for libhack, where _REENTRANT is not defined;
arenas_map_key is used only when NO_TLS && _REENTRANT.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/lib/libc/stdlib/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/lib/libc/stdlib/jemalloc.c
diff -u src/lib/libc/stdlib/jemalloc.c:1.49 src/lib/libc/stdlib/jemalloc.c:1.50
--- src/lib/libc/stdlib/jemalloc.c:1.49	Tue Apr 21 22:22:55 2020
+++ src/lib/libc/stdlib/jemalloc.c	Wed Apr 22 08:45:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: jemalloc.c,v 1.49 2020/04/21 22:22:55 joerg Exp $	*/
+/*	$NetBSD: jemalloc.c,v 1.50 2020/04/22 08:45:06 rin Exp $	*/
 
 /*-
  * Copyright (C) 2006,2007 Jason Evans <[email protected]>.
@@ -117,7 +117,7 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */ 
-__RCSID("$NetBSD: jemalloc.c,v 1.49 2020/04/21 22:22:55 joerg Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.50 2020/04/22 08:45:06 rin Exp $");
 
 #ifdef __FreeBSD__
 #include "libc_private.h"
@@ -775,14 +775,14 @@ static __attribute__((tls_model("initial
 __thread arena_t	**arenas_map;
 #else
 static arena_t	**arenas_map;
-static thread_key_t arenas_map_key = -1;
 #endif
 
 #if !defined(NO_TLS) || !defined(_REENTRANT)
 # define	get_arenas_map()	(arenas_map)
 # define	set_arenas_map(x)	(arenas_map = x)
-#else
+#else /* NO_TLS && _REENTRANT */
 
+static thread_key_t arenas_map_key = -1;
 
 static inline arena_t **
 get_arenas_map(void)
@@ -823,7 +823,7 @@ set_arenas_map(arena_t **a)
 	thr_setspecific(arenas_map_key, a);
 #endif
 }
-#endif
+#endif /* NO_TLS && _REENTRANT */
 
 #ifdef MALLOC_STATS
 /* Chunk statistics. */

Reply via email to