Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/stdlib Err on the safe side for small memory alloca...



details:   https://anonhg.NetBSD.org/src/rev/8d53daec80ae
branches:  trunk
changeset: 326588:8d53daec80ae
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Feb 05 11:32:15 2014 +0000

description:
Err on the safe side for small memory allocations and provide 4byte
alignment by default.  Override this to 8byte alignment for alpha and arm
eabi.

Someone (tm) can review this change once the standards and compiler(s)
have sorted themselves out.

diffstat:

 lib/libc/stdlib/jemalloc.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r d2ba08dd6bd6 -r 8d53daec80ae lib/libc/stdlib/jemalloc.c
--- a/lib/libc/stdlib/jemalloc.c        Wed Feb 05 03:49:48 2014 +0000
+++ b/lib/libc/stdlib/jemalloc.c        Wed Feb 05 11:32:15 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: jemalloc.c,v 1.29 2013/09/12 15:35:15 joerg Exp $      */
+/*     $NetBSD: jemalloc.c,v 1.30 2014/02/05 11:32:15 skrll Exp $      */
 
 /*-
  * Copyright (C) 2006,2007 Jason Evans <jasone%FreeBSD.org@localhost>.
@@ -118,7 +118,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.29 2013/09/12 15:35:15 joerg Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.30 2014/02/05 11:32:15 skrll Exp $");
 
 #ifdef __FreeBSD__
 #include "libc_private.h"
@@ -228,6 +228,7 @@
 #ifdef __alpha__
 #  define QUANTUM_2POW_MIN     4
 #  define SIZEOF_PTR_2POW      3
+#  define TINY_MIN_2POW                3
 #  define NO_TLS
 #endif
 #ifdef __sparc64__
@@ -243,6 +244,9 @@
 #  define QUANTUM_2POW_MIN     3
 #  define SIZEOF_PTR_2POW      2
 #  define USE_BRK
+#  ifdef __ARM_EABI__
+#    define TINY_MIN_2POW      3
+#  endif
 #  define NO_TLS
 #endif
 #ifdef __powerpc__
@@ -303,7 +307,9 @@
 #define        CACHELINE               ((size_t)(1 << CACHELINE_2POW))
 
 /* Smallest size class to support. */
-#define        TINY_MIN_2POW           1
+#ifndef TINY_MIN_2POW
+#define        TINY_MIN_2POW           2
+#endif
 
 /*
  * Maximum size class that is a multiple of the quantum, but not (necessarily)



Home | Main Index | Thread Index | Old Index