[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree

zrouter-src-freebsd at zrouter.org zrouter-src-freebsd at zrouter.org
Tue Apr 17 11:49:00 UTC 2012


details:   http://zrouter.org/hg/FreeBSD/head//rev/e3f5e8dd2700
changeset: 454:e3f5e8dd2700
user:      Aleksandr Rybalko <ray at ddteam.net>
date:      Tue Apr 17 14:49:11 2012 +0300
description:
Revert jemalloc import, because it not doen yet (temporarily)

diffstat:

 head/include/malloc_np.h          |  29 +----------------------------
 head/include/stdlib.h             |   9 +++++----
 head/lib/libc/Makefile            |   3 +--
 head/lib/libc/gen/tls.c           |  25 ++++++++++---------------
 head/lib/libc/stdlib/Makefile.inc |  18 +++++++++++++-----
 head/lib/libc/stdlib/Symbol.map   |  14 +++++++++++++-
 6 files changed, 43 insertions(+), 55 deletions(-)

diffs (274 lines):

diff -r f2935497fa04 -r e3f5e8dd2700 head/include/malloc_np.h
--- a/head/include/malloc_np.h	Tue Apr 17 11:51:51 2012 +0300
+++ b/head/include/malloc_np.h	Tue Apr 17 14:49:11 2012 +0300
@@ -26,43 +26,16 @@
  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: head/include/malloc_np.h 234370 2012-04-17 07:22:14Z jasone $
+ * $FreeBSD: head/include/malloc_np.h 160056 2006-06-30 20:57:41Z jasone $
  */
 
 #ifndef _MALLOC_NP_H_
 #define	_MALLOC_NP_H_
 #include <sys/cdefs.h>
 #include <sys/types.h>
-#include <strings.h>
 
 __BEGIN_DECLS
 size_t	malloc_usable_size(const void *ptr);
-
-void	malloc_stats_print(void (*write_cb)(void *, const char *),
-    void *cbopaque, const char *opts);
-int	mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp,
-    size_t newlen);
-int	mallctlnametomib(const char *name, size_t *mibp, size_t *miblenp);
-int	mallctlbymib(const size_t *mib, size_t miblen, void *oldp,
-    size_t *oldlenp, void *newp, size_t newlen);
-
-#define	ALLOCM_LG_ALIGN(la)	(la)
-#define	ALLOCM_ALIGN(a)	(ffsl(a)-1)
-#define	ALLOCM_ZERO	((int)0x40)
-#define	ALLOCM_NO_MOVE	((int)0x80)
-
-#define	ALLOCM_SUCCESS		0
-#define	ALLOCM_ERR_OOM		1
-#define	ALLOCM_ERR_NOT_MOVED	2
-
-int	allocm(void **ptr, size_t *rsize, size_t size, int flags)
-    __attribute__(nonnull(1));
-int	rallocm(void **ptr, size_t *rsize, size_t size, size_t extra,
-    int flags) __attribute__(nonnull(1));
-int	sallocm(const void *ptr, size_t *rsize, int flags)
-    __attribute__(nonnull(1));
-int	dallocm(void *ptr, int flags) __attribute__(nonnull(1));
-int	nallocm(size_t *rsize, size_t size, int flags);
 __END_DECLS
 
 #endif /* _MALLOC_NP_H_ */
diff -r f2935497fa04 -r e3f5e8dd2700 head/include/stdlib.h
--- a/head/include/stdlib.h	Tue Apr 17 11:51:51 2012 +0300
+++ b/head/include/stdlib.h	Tue Apr 17 14:49:11 2012 +0300
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)stdlib.h	8.5 (Berkeley) 5/19/95
- * $FreeBSD: head/include/stdlib.h 234370 2012-04-17 07:22:14Z jasone $
+ * $FreeBSD: head/include/stdlib.h 233600 2012-03-28 12:11:54Z theraven $
  */
 
 #ifndef _STDLIB_H_
@@ -155,7 +155,7 @@
  * If we're in a mode greater than C99, expose C11 functions.
  */
 #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
-void *	aligned_alloc(size_t, size_t) __malloc_like;
+void *	aligned_alloc(size_t, size_t);
 int	at_quick_exit(void (*)(void));
 _Noreturn void
 	quick_exit(int);
@@ -228,8 +228,9 @@
 #endif /* __XSI_VISIBLE */
 
 #if __BSD_VISIBLE
-extern const char *malloc_conf;
-extern void (*malloc_message)(void *, const char *);
+extern const char *_malloc_options;
+extern void (*_malloc_message)(const char *, const char *, const char *,
+	    const char *);
 
 /*
  * The alloca() function can't be implemented in C, and on some
diff -r f2935497fa04 -r e3f5e8dd2700 head/lib/libc/Makefile
--- a/head/lib/libc/Makefile	Tue Apr 17 11:51:51 2012 +0300
+++ b/head/lib/libc/Makefile	Tue Apr 17 14:49:11 2012 +0300
@@ -1,5 +1,5 @@
 #	@(#)Makefile	8.2 (Berkeley) 2/3/94
-# $FreeBSD: head/lib/libc/Makefile 234370 2012-04-17 07:22:14Z jasone $
+# $FreeBSD: head/lib/libc/Makefile 229368 2012-01-03 07:14:01Z ed $
 
 SHLIBDIR?= /lib
 
@@ -79,7 +79,6 @@
 .include "${.CURDIR}/resolv/Makefile.inc"
 .include "${.CURDIR}/stdio/Makefile.inc"
 .include "${.CURDIR}/stdlib/Makefile.inc"
-.include "${.CURDIR}/stdlib/jemalloc/Makefile.inc"
 .include "${.CURDIR}/stdtime/Makefile.inc"
 .include "${.CURDIR}/string/Makefile.inc"
 .include "${.CURDIR}/sys/Makefile.inc"
diff -r f2935497fa04 -r e3f5e8dd2700 head/lib/libc/gen/tls.c
--- a/head/lib/libc/gen/tls.c	Tue Apr 17 11:51:51 2012 +0300
+++ b/head/lib/libc/gen/tls.c	Tue Apr 17 14:49:11 2012 +0300
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: head/lib/libc/gen/tls.c 234370 2012-04-17 07:22:14Z jasone $
+ *	$FreeBSD: head/lib/libc/gen/tls.c 232582 2012-03-06 03:42:54Z gonzo $
  */
 
 /*
@@ -39,11 +39,6 @@
 
 #include "libc_private.h"
 
-/* Provided by jemalloc to avoid bootstrapping issues. */
-void	*a0malloc(size_t size);
-void	*a0calloc(size_t num, size_t size);
-void	a0free(void *ptr);
-
 __weak_reference(__libc_allocate_tls, _rtld_allocate_tls);
 __weak_reference(__libc_free_tls, _rtld_free_tls);
 
@@ -125,8 +120,8 @@
 
 	tls = (Elf_Addr **)((Elf_Addr)tcb + tcbsize - TLS_TCB_SIZE);
 	dtv = tls[0];
-	a0free(dtv);
-	a0free(tcb);
+	free(dtv);
+	free(tcb);
 }
 
 /*
@@ -142,18 +137,18 @@
 	if (oldtcb != NULL && tcbsize == TLS_TCB_SIZE)
 		return (oldtcb);
 
-	tcb = a0calloc(1, tls_static_space + tcbsize - TLS_TCB_SIZE);
+	tcb = calloc(1, tls_static_space + tcbsize - TLS_TCB_SIZE);
 	tls = (Elf_Addr **)(tcb + tcbsize - TLS_TCB_SIZE);
 
 	if (oldtcb != NULL) {
 		memcpy(tls, oldtcb, tls_static_space);
-		a0free(oldtcb);
+		free(oldtcb);
 
 		/* Adjust the DTV. */
 		dtv = tls[0];
 		dtv[2] = (Elf_Addr)tls + TLS_TCB_SIZE;
 	} else {
-		dtv = a0malloc(3 * sizeof(Elf_Addr));
+		dtv = malloc(3 * sizeof(Elf_Addr));
 		tls[0] = dtv;
 		dtv[0] = 1;
 		dtv[1] = 1;
@@ -194,8 +189,8 @@
 	dtv = ((Elf_Addr**)tcb)[1];
 	tlsend = (Elf_Addr) tcb;
 	tlsstart = tlsend - size;
-	a0free((void*) tlsstart);
-	a0free(dtv);
+	free((void*) tlsstart);
+	free(dtv);
 }
 
 /*
@@ -213,8 +208,8 @@
 
 	if (tcbsize < 2 * sizeof(Elf_Addr))
 		tcbsize = 2 * sizeof(Elf_Addr);
-	tls = a0calloc(1, size + tcbsize);
-	dtv = a0malloc(3 * sizeof(Elf_Addr));
+	tls = calloc(1, size + tcbsize);
+	dtv = malloc(3 * sizeof(Elf_Addr));
 
 	segbase = (Elf_Addr)(tls + size);
 	((Elf_Addr*)segbase)[0] = segbase;
diff -r f2935497fa04 -r e3f5e8dd2700 head/lib/libc/stdlib/Makefile.inc
--- a/head/lib/libc/stdlib/Makefile.inc	Tue Apr 17 11:51:51 2012 +0300
+++ b/head/lib/libc/stdlib/Makefile.inc	Tue Apr 17 14:49:11 2012 +0300
@@ -1,5 +1,5 @@
 #	from @(#)Makefile.inc	8.3 (Berkeley) 2/4/95
-# $FreeBSD: head/lib/libc/stdlib/Makefile.inc 234370 2012-04-17 07:22:14Z jasone $
+# $FreeBSD: head/lib/libc/stdlib/Makefile.inc 229848 2012-01-09 06:36:28Z ed $
 
 # machine-independent stdlib sources
 .PATH: ${.CURDIR}/${LIBC_ARCH}/stdlib ${.CURDIR}/stdlib
@@ -7,7 +7,7 @@
 MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
 	bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \
 	getsubopt.c hcreate.c heapsort.c imaxabs.c imaxdiv.c \
-	insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \
+	insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c malloc.c \
 	merge.c ptsname.c qsort.c qsort_r.c quick_exit.c radixsort.c rand.c \
 	random.c reallocf.c realpath.c remque.c strfmon.c strtoimax.c \
 	strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \
@@ -18,17 +18,18 @@
 # machine-dependent stdlib sources
 .sinclude "${.CURDIR}/${LIBC_ARCH}/stdlib/Makefile.inc"
 
-MAN+=	a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 \
+MAN+=	a64l.3 abort.3 abs.3 aligned_alloc.3 alloca.3 atexit.3 atof.3 \
 	atoi.3 atol.3 at_quick_exit.3 bsearch.3 \
 	div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \
 	hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 llabs.3 lldiv.3 \
-	lsearch.3 memory.3 ptsname.3 qsort.3 \
+	lsearch.3 malloc.3 memory.3 ptsname.3 qsort.3 \
 	quick_exit.3 \
-	radixsort.3 rand.3 random.3 reallocf.3 \
+	radixsort.3 rand.3 random.3 \
 	realpath.3 strfmon.3 strtod.3 strtol.3 strtonum.3 strtoul.3 system.3 \
 	tsearch.3
 
 MLINKS+=a64l.3 l64a.3 a64l.3 l64a_r.3
+MLINKS+=aligned_alloc.3 posix_memalign.3
 MLINKS+=atol.3 atoll.3
 MLINKS+=exit.3 _Exit.3
 MLINKS+=getenv.3 putenv.3 getenv.3 setenv.3 getenv.3 unsetenv.3
@@ -45,4 +46,11 @@
 MLINKS+=strtod.3 strtof.3 strtod.3 strtold.3
 MLINKS+=strtol.3 strtoll.3 strtol.3 strtoq.3 strtol.3 strtoimax.3
 MLINKS+=strtoul.3 strtoull.3 strtoul.3 strtouq.3 strtoul.3 strtoumax.3
+MLINKS+=malloc.3 calloc.3 malloc.3 free.3 malloc.3 malloc.conf.5 \
+	malloc.3 realloc.3 malloc.3 reallocf.3 malloc.3 malloc_usable_size.3
 MLINKS+=tsearch.3 tdelete.3 tsearch.3 tfind.3 tsearch.3 twalk.3
+
+.if defined(MALLOC_PRODUCTION)
+CFLAGS+=	-DMALLOC_PRODUCTION
+.endif
+
diff -r f2935497fa04 -r e3f5e8dd2700 head/lib/libc/stdlib/Symbol.map
--- a/head/lib/libc/stdlib/Symbol.map	Tue Apr 17 11:51:51 2012 +0300
+++ b/head/lib/libc/stdlib/Symbol.map	Tue Apr 17 14:49:11 2012 +0300
@@ -1,5 +1,5 @@
 /*
- * $FreeBSD: head/lib/libc/stdlib/Symbol.map 234370 2012-04-17 07:22:14Z jasone $
+ * $FreeBSD: head/lib/libc/stdlib/Symbol.map 229848 2012-01-09 06:36:28Z ed $
  */
 
 FBSD_1.0 {
@@ -47,6 +47,14 @@
 	lldiv;
 	lsearch;
 	lfind;
+	_malloc_options;
+	_malloc_message;
+	malloc;
+	posix_memalign;
+	calloc;
+	realloc;
+	free;
+	malloc_usable_size;
 	mergesort;
 	putenv;
 	qsort_r;
@@ -85,6 +93,7 @@
 };
 
 FBSD_1.3 {
+	aligned_alloc;
 	at_quick_exit;
 	atof_l;
 	atoi_l;
@@ -105,6 +114,9 @@
 };
 
 FBSDprivate_1.0 {
+	_malloc_thread_cleanup;
+	_malloc_prefork;
+	_malloc_postfork;
 	__system;
 	_system;
 };


More information about the Zrouter-src-freebsd mailing list