Dactyloidae/memory
Olivier Certner b7e6f5fd45 Issue #1699 - Part 3b: mozjemalloc: Bootstrap allocator, early diversion for FreeBSD
Coded a simple memory allocator meant to be used during jemalloc bootstrap
(malloc_init_hard()). Although protected by "#ifdef __FreeBSD__", it is not
FreeBSD-specific: Any POSIX platform could use it.

Hook it so that it is used in place of jemalloc's own routines while
malloc_init_hard() is executing or memory for mutexes is being
allocated. Currently, 'malloc', 'calloc', '*memalign' and 'free' are diverted
during init or lock initializations.

Details are quite complex, see the big comment block starting with "There are
several problematic interactions between FreeBSD's libthr and this jemalloc."
for more explanations.

Also replaced ad-hoc BSD code to determine the number of CPUs with 'sysconf',
which is POSIX-compliant (and supported on modern BSDs).
2021-01-08 17:40:53 +08:00
..
build Issue #1656 - Part 6: Clean up the build files 2020-09-25 22:04:23 +08:00
fallible Issue #1656 - Part 6: Clean up the build files 2020-09-25 22:04:23 +08:00
gtest Issue #1656 - Part 6: Clean up the build files 2020-09-25 22:04:23 +08:00
mozalloc Issue #1656 - Part 6: Clean up the build files 2020-09-25 22:04:23 +08:00
mozjemalloc Issue #1699 - Part 3b: mozjemalloc: Bootstrap allocator, early diversion for FreeBSD 2021-01-08 17:40:53 +08:00
replace Issue #1656 - Part 6: Clean up the build files 2020-09-25 22:04:23 +08:00
volatile Issue #1656 - Part 6: Clean up the build files 2020-09-25 22:04:23 +08:00
moz.build Issue #1656 - Part 6: Clean up the build files 2020-09-25 22:04:23 +08:00