| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: jemalloc.c,v 1.38 2015/07/26 17:21:55 martin Exp $ */ | | 1 | /* $NetBSD: jemalloc.c,v 1.39 2016/01/24 21:56:43 christos Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (C) 2006,2007 Jason Evans <jasone@FreeBSD.org>. | | 4 | * Copyright (C) 2006,2007 Jason Evans <jasone@FreeBSD.org>. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice(s), this list of conditions and the following disclaimer as | | 11 | * notice(s), this list of conditions and the following disclaimer as |
12 | * the first lines of this file unmodified other than the possible | | 12 | * the first lines of this file unmodified other than the possible |
13 | * addition of one or more copyright notices. | | 13 | * addition of one or more copyright notices. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -108,53 +108,53 @@ | | | @@ -108,53 +108,53 @@ |
108 | /* | | 108 | /* |
109 | * MALLOC_PRODUCTION disables assertions and statistics gathering. It also | | 109 | * MALLOC_PRODUCTION disables assertions and statistics gathering. It also |
110 | * defaults the A and J runtime options to off. These settings are appropriate | | 110 | * defaults the A and J runtime options to off. These settings are appropriate |
111 | * for production systems. | | 111 | * for production systems. |
112 | */ | | 112 | */ |
113 | #define MALLOC_PRODUCTION | | 113 | #define MALLOC_PRODUCTION |
114 | | | 114 | |
115 | #ifndef MALLOC_PRODUCTION | | 115 | #ifndef MALLOC_PRODUCTION |
116 | # define MALLOC_DEBUG | | 116 | # define MALLOC_DEBUG |
117 | #endif | | 117 | #endif |
118 | | | 118 | |
119 | #include <sys/cdefs.h> | | 119 | #include <sys/cdefs.h> |
120 | /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */ | | 120 | /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */ |
121 | __RCSID("$NetBSD: jemalloc.c,v 1.38 2015/07/26 17:21:55 martin Exp $"); | | 121 | __RCSID("$NetBSD: jemalloc.c,v 1.39 2016/01/24 21:56:43 christos Exp $"); |
122 | | | 122 | |
123 | #ifdef __FreeBSD__ | | 123 | #ifdef __FreeBSD__ |
124 | #include "libc_private.h" | | 124 | #include "libc_private.h" |
125 | #ifdef MALLOC_DEBUG | | 125 | #ifdef MALLOC_DEBUG |
126 | # define _LOCK_DEBUG | | 126 | # define _LOCK_DEBUG |
127 | #endif | | 127 | #endif |
128 | #include "spinlock.h" | | 128 | #include "spinlock.h" |
129 | #endif | | 129 | #endif |
130 | #include "namespace.h" | | 130 | #include "namespace.h" |
131 | #include <sys/mman.h> | | 131 | #include <sys/mman.h> |
132 | #include <sys/param.h> | | 132 | #include <sys/param.h> |
133 | #ifdef __FreeBSD__ | | 133 | #ifdef __FreeBSD__ |
134 | #include <sys/stddef.h> | | 134 | #include <sys/stddef.h> |
135 | #endif | | 135 | #endif |
136 | #include <sys/time.h> | | 136 | #include <sys/time.h> |
137 | #include <sys/types.h> | | 137 | #include <sys/types.h> |
138 | #include <sys/sysctl.h> | | 138 | #include <sys/sysctl.h> |
139 | #include <sys/tree.h> | | 139 | #include <sys/tree.h> |
140 | #include <sys/uio.h> | | 140 | #include <sys/uio.h> |
141 | #include <sys/ktrace.h> /* Must come after several other sys/ includes. */ | | 141 | #include <sys/ktrace.h> /* Must come after several other sys/ includes. */ |
142 | | | 142 | |
143 | #ifdef __FreeBSD__ | | 143 | #ifdef __FreeBSD__ |
144 | #include <machine/atomic.h> | | 144 | #include <machine/atomic.h> |
145 | #include <machine/cpufunc.h> | | 145 | #include <machine/cpufunc.h> |
146 | #endif | | | |
147 | #include <machine/vmparam.h> | | 146 | #include <machine/vmparam.h> |
| | | 147 | #endif |
148 | | | 148 | |
149 | #include <errno.h> | | 149 | #include <errno.h> |
150 | #include <limits.h> | | 150 | #include <limits.h> |
151 | #include <pthread.h> | | 151 | #include <pthread.h> |
152 | #include <sched.h> | | 152 | #include <sched.h> |
153 | #include <stdarg.h> | | 153 | #include <stdarg.h> |
154 | #include <stdbool.h> | | 154 | #include <stdbool.h> |
155 | #include <stdio.h> | | 155 | #include <stdio.h> |
156 | #include <stdint.h> | | 156 | #include <stdint.h> |
157 | #include <stdlib.h> | | 157 | #include <stdlib.h> |
158 | #include <string.h> | | 158 | #include <string.h> |
159 | #include <strings.h> | | 159 | #include <strings.h> |
160 | #include <unistd.h> | | 160 | #include <unistd.h> |