History log of /netbsd-src/lib/libc/stdlib/jemalloc.c (Results 1 – 25 of 64)
Revision Date Author Comments
# 6b3ee451 13-Dec-2023 mrg <mrg@NetBSD.org>

make malloc_usable_size() visible with old jemalloc.

it's in <malloc.h> and applications like firefox expect it.

XXX: pullup-10


# a3628a91 14-Oct-2023 ad <ad@NetBSD.org>

A few more branch hints.


# 57fcbaeb 14-Oct-2023 ad <ad@NetBSD.org>

Cherry pick a fix from FreeBSD:

commit 80bc871bdd4a8254ce19a65a54c8c918dd3ddd11
Author: Konstantin Belousov <kib@FreeBSD.org>
Date: Sat Sep 12 18:16:46 2009 +0000

MFC r196861:
Handle zero

Cherry pick a fix from FreeBSD:

commit 80bc871bdd4a8254ce19a65a54c8c918dd3ddd11
Author: Konstantin Belousov <kib@FreeBSD.org>
Date: Sat Sep 12 18:16:46 2009 +0000

MFC r196861:
Handle zero size for posix_memalign. Return NULL or unique address
according to the 'V' option.

show more ...


# 13122b28 14-Oct-2023 ad <ad@NetBSD.org>

Cherry pick a fix from FreeBSD:

commit 52d7a117c0fe8bd0226d964f4272131700035f12
Author: Jason Evans <jasone@FreeBSD.org>
Date: Thu Aug 14 17:03:29 2008 +0000

Re-order the terms of an expressi

Cherry pick a fix from FreeBSD:

commit 52d7a117c0fe8bd0226d964f4272131700035f12
Author: Jason Evans <jasone@FreeBSD.org>
Date: Thu Aug 14 17:03:29 2008 +0000

Re-order the terms of an expression in arena_run_reg_dalloc() to correctly
detect whether the integer division table is large enough to handle the
divisor. Before this change, the last two table elements were never used,
thus causing the slow path to be used for those divisors.

show more ...


# a52713e5 14-Oct-2023 ad <ad@NetBSD.org>

Fix a bug in the rbtree conversion.


# 744309c5 14-Oct-2023 mrg <mrg@NetBSD.org>

fix compile error on 32-bit platforms.


# 562025fd 13-Oct-2023 ad <ad@NetBSD.org>

Convert to use Matt Thomas's rbtree, which the env code probably already
pulls into libc. amd64 object size before and after:

text data bss dec hex filename
21001 88

Convert to use Matt Thomas's rbtree, which the env code probably already
pulls into libc. amd64 object size before and after:

text data bss dec hex filename
21001 88 365 21454 53ce jemalloc.po
14991 184 429 15604 3cf4 jemalloc.po

libmicro on AMD Athlon Silver 3050e comparing this and the revision before
previous (i.e. the old code, versus arena changes + rbtree changes):

exit_10_nolibc 135.168300 128.07790[ +5.5%]
fork_100 180.539040 149.63721[ +20.7%]
fork_1000 200.421650 167.09660[ +19.9%]
mallocT2_10 0.132920 0.13317[ -0.2%]
mallocT2_100 0.136350 0.13635[ +0.0%]
mallocT2_100k 0.258690 0.26641[ -3.0%]
mallocT2_10k 0.223340 0.22733[ -1.8%]
mallocT2_1k 0.137170 0.14254[ -3.9%]
malloc_10 0.100540 0.10849[ -7.9%]
malloc_100 0.107290 0.10753[ -0.2%]
malloc_100k 0.193560 0.19355[ +0.0%]
malloc_10k 0.173250 0.17454[ -0.7%]
malloc_1k 0.113490 0.11335[ +0.1%]

show more ...


# bf5f78d5 13-Oct-2023 ad <ad@NetBSD.org>

Minor changes to jemalloc100 (the old one that only vax etc currently uses).

- Don't use TLS nor pretend to hash out arenas to reduce lock contention,
because NetBSD uses thr_curcpu() to choose ar

Minor changes to jemalloc100 (the old one that only vax etc currently uses).

- Don't use TLS nor pretend to hash out arenas to reduce lock contention,
because NetBSD uses thr_curcpu() to choose arena (i.e. per-CPU arenas).

- In a single threaded process, don't prepare "ncpus" worth of arenas,
allocate only one.

- Use getpagesize() since it caches the return.

- Sprinkle branch hints.

- Make MALLOC_TRACE and MALLOC_DEBUG work again.

show more ...


# 75b842b8 07-May-2023 skrll <skrll@NetBSD.org>

RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).


# d2296b07 30-Nov-2022 skrll <skrll@NetBSD.org>

Trailing whitespace


# cd15afc9 30-Aug-2021 christos <christos@NetBSD.org>

Remove lint workarounds


# 8409cf4a 15-May-2020 joerg <joerg@NetBSD.org>

Hook up proper fork lock handling for malloc:
- lock all relevant mutexes just before fork
- unlock all mutexes just after fork in the parent
- full reinit non-spinlocks in the child
This is not usin

Hook up proper fork lock handling for malloc:
- lock all relevant mutexes just before fork
- unlock all mutexes just after fork in the parent
- full reinit non-spinlocks in the child
This is not using the normal pthread_atfork interface to ensure order of
operation, malloc is used as implementation detail too often.

show more ...


# e6631f72 03-May-2020 mrg <mrg@NetBSD.org>

turn off TLS for mips on old jemalloc. it doesn't work.


# 1d3b363c 22-Apr-2020 rin <rin@NetBSD.org>

Use __mc68010__ to distinguish m68000 (sun2) from other m68k ports;
__mc68000__ is defined both for m68000 and m68k.


# 45df14be 22-Apr-2020 rin <rin@NetBSD.org>

Fix previous for libhack, where _REENTRANT is not defined;
arenas_map_key is used only when NO_TLS && _REENTRANT.


# 880ddc3f 21-Apr-2020 joerg <joerg@NetBSD.org>

Switch to using TLS in old jemalloc for everywhere but VAX and sun2.


# 174eb28a 13-Jan-2020 joerg <joerg@NetBSD.org>

Fix atfork malloc handling to include all the locks in old jemalloc.


# 2de10fd6 13-Jan-2020 joerg <joerg@NetBSD.org>

Fix aarch64 definition in old jemalloc

There is no platform-specific reason for avoiding TLS. The tiny
allocations should be aligned the same as small allocations for ABI
reasons.


# 15c525fb 28-Mar-2019 christos <christos@NetBSD.org>

fix compilation for non _REENTRANT


# f34d1bdd 25-Jul-2018 kamil <kamil@NetBSD.org>

Avoid undefined behavior in left bit shift in jemalloc(3)

Change the type of shifted value to unsigned to prevent altering the
signedness bit.

jemalloc.c:1707:14, left shift of 1 by 31 places canno

Avoid undefined behavior in left bit shift in jemalloc(3)

Change the type of shifted value to unsigned to prevent altering the
signedness bit.

jemalloc.c:1707:14, left shift of 1 by 31 places cannot be represented in type 'int'
jemalloc.c:1724:15, left shift of 1 by 31 places cannot be represented in type 'int'
jemalloc.c:1840:28, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with micro-UBSan in the user mode.

show more ...


# be18dbc4 01-Dec-2017 mrg <mrg@NetBSD.org>

normalise some indentation. NFC.


# f9ef5aa2 16-Nov-2017 skrll <skrll@NetBSD.org>

The HPPA architectures (1.1 and 2.0) both define quadruple-word (128-bit)
floating point types. Adjust alignment to match.


# 3ccc6b27 19-May-2017 christos <christos@NetBSD.org>

remove accidental __strong_alias additions, noticed by coypu.


# 0a20cdb1 19-May-2017 christos <christos@NetBSD.org>

use strerror_r_ss()


# c75fe7b8 12-Apr-2016 joerg <joerg@NetBSD.org>

lib/50791: Instead of using sorting the arena chunks by address only,
sort by size of the longest run and address as tie break. Avoids long
linear searches for code heavy on medium sized allocations.


123