Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/lib/libc/stdlib/jemalloc.c,v rcsdiff: /ftp/cvs/cvsroot/src/lib/libc/stdlib/jemalloc.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.34.2.3 retrieving revision 1.43 diff -u -p -r1.34.2.3 -r1.43 --- src/lib/libc/stdlib/jemalloc.c 2016/05/10 09:10:11 1.34.2.3 +++ src/lib/libc/stdlib/jemalloc.c 2017/11/16 13:54:00 1.43 @@ -1,4 +1,4 @@ -/* $NetBSD: jemalloc.c,v 1.34.2.3 2016/05/10 09:10:11 martin Exp $ */ +/* $NetBSD: jemalloc.c,v 1.43 2017/11/16 13:54:00 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.34.2.3 2016/05/10 09:10:11 martin Exp $"); +__RCSID("$NetBSD: jemalloc.c,v 1.43 2017/11/16 13:54:00 skrll Exp $"); #ifdef __FreeBSD__ #include "libc_private.h" @@ -143,8 +143,8 @@ __RCSID("$NetBSD: jemalloc.c,v 1.34.2.3 #ifdef __FreeBSD__ #include #include -#endif #include +#endif #include #include @@ -163,27 +163,7 @@ __RCSID("$NetBSD: jemalloc.c,v 1.34.2.3 # include # include "extern.h" -#define STRERROR_R(a, b, c) __strerror_r(a, b, c); -/* - * A non localized version of strerror, that avoids bringing in - * stdio and the locale code. All the malloc messages are in English - * so why bother? - */ -static int -__strerror_r(int e, char *s, size_t l) -{ - int rval; - size_t slen; - - if (e >= 0 && e < sys_nerr) { - slen = strlcpy(s, sys_errlist[e], l); - rval = 0; - } else { - slen = snprintf_ss(s, l, "Unknown error %u", e); - rval = EINVAL; - } - return slen >= l ? ERANGE : rval; -} +#define STRERROR_R(a, b, c) strerror_r_ss(a, b, c); #endif #ifdef __FreeBSD__ @@ -275,6 +255,11 @@ __strerror_r(int e, char *s, size_t l) # define SIZEOF_PTR_2POW 2 # define USE_BRK #endif +#ifdef __or1k__ +# define QUANTUM_2POW_MIN 4 +# define SIZEOF_PTR_2POW 2 +# define USE_BRK +#endif #ifdef __vax__ # define QUANTUM_2POW_MIN 4 # define SIZEOF_PTR_2POW 2 @@ -290,13 +275,19 @@ __strerror_r(int e, char *s, size_t l) # define SIZEOF_PTR_2POW 2 # define USE_BRK #endif -#ifdef __mips__ -# define QUANTUM_2POW_MIN 4 +#if defined(__mips__) || defined(__riscv__) +# ifdef _LP64 +# define SIZEOF_PTR_2POW 3 +# define TINY_MIN_2POW 3 +# else # define SIZEOF_PTR_2POW 2 -# define USE_BRK +# endif +# define QUANTUM_2POW_MIN 4 +# define USE_BRK #endif #ifdef __hppa__ # define QUANTUM_2POW_MIN 4 +# define TINY_MIN_2POW 4 # define SIZEOF_PTR_2POW 2 # define USE_BRK #endif