mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 14:41:42 +03:00
Port to FreeBSD.
Use FreeBSD-specific functions (_pthread_mutex_init_calloc_cb(),
_malloc_{pre,post}fork()) to avoid bootstrapping issues due to
allocation in libc and libthr.
Add malloc_strtoumax() and use it instead of strtoul(). Disable
validation code in malloc_vsnprintf() and malloc_strtoumax() until
jemalloc is initialized. This is necessary because locale
initialization causes allocation for both vsnprintf() and strtoumax().
Force the lazy-lock feature on in order to avoid pthread_self(),
because it causes allocation.
Use syscall(SYS_write, ...) rather than write(...), because libthr wraps
write() and causes allocation. Without this workaround, it would not be
possible to print error messages in malloc_conf_init() without
substantially reworking bootstrapping.
Fix choose_arena_hard() to look at how many threads are assigned to the
candidate choice, rather than checking whether the arena is
uninitialized. This bug potentially caused more arenas to be
initialized than necessary.
This commit is contained in:
parent
6da5418ded
commit
41b6afb834
13 changed files with 237 additions and 47 deletions
10
README
10
README
|
|
@ -1,10 +1,10 @@
|
|||
jemalloc is a general-purpose scalable concurrent malloc(3) implementation.
|
||||
This distribution is a stand-alone "portable" implementation that currently
|
||||
targets Linux and Apple OS X. jemalloc is included as the default allocator in
|
||||
the FreeBSD and NetBSD operating systems, and it is used by the Mozilla Firefox
|
||||
web browser on Microsoft Windows-related platforms. Depending on your needs,
|
||||
one of the other divergent versions may suit your needs better than this
|
||||
distribution.
|
||||
targets FreeBSD, Linux and Apple OS X. jemalloc is included as the default
|
||||
allocator in the FreeBSD and NetBSD operating systems, and it is used by the
|
||||
Mozilla Firefox web browser on Microsoft Windows-related platforms. Depending
|
||||
on your needs, one of the other divergent versions may suit your needs better
|
||||
than this distribution.
|
||||
|
||||
The COPYING file contains copyright and licensing information.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue