From 03dbd3879297465772f3d7ed2176a5bc0a8498e5 Mon Sep 17 00:00:00 2001 From: skrll Date: Wed, 5 Feb 2014 11:32:15 +0000 Subject: [PATCH] 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. --- lib/libc/stdlib/jemalloc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdlib/jemalloc.c b/lib/libc/stdlib/jemalloc.c index e56af350ef4f..9f5655aa54ea 100644 --- a/lib/libc/stdlib/jemalloc.c +++ b/lib/libc/stdlib/jemalloc.c @@ -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 . @@ -118,7 +118,7 @@ #include /* __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 @@ __strerror_r(int e, char *s, size_t l) #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 @@ __strerror_r(int e, char *s, size_t l) # 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 @@ __strerror_r(int e, char *s, size_t l) #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)