server-skynet-source-3rd-je.../src
Dave Watson 0f8313659e malloc: Add a fastpath
This diff adds a fastpath that assumes size <= SC_LOOKUP_MAXCLASS, and
that we hit tcache.  If either of these is false, we fall back to
the previous codepath (renamed 'malloc_default').

Crucially, we only tail call malloc_default, and with the same kind
and number of arguments, so that both clang and gcc tail-calling
will kick in - therefore malloc() gets treated as a leaf function,
and there are *no* caller-saved registers.   Previously malloc() contained
5 caller saved registers on x64, resulting in at least 10 extra
memory-movement instructions.

In microbenchmarks this results in up to ~10% improvement in malloc()
fastpath.  In real programs, this is a ~1% CPU and latency improvement
overall.
2018-10-18 08:32:19 -07:00
..
arena.c Add stats for the size of extent_avail heap 2018-08-02 10:16:06 -07:00
background_thread.c Clean compilation -Wextra 2018-07-09 21:40:42 -07:00
base.c SC: Remove global data. 2018-07-23 13:37:08 -07:00
bin.c Hide size class computation behind a layer of indirection. 2018-07-12 20:53:06 -07:00
bitmap.c Revert "Remove BITMAP_USE_TREE." 2017-04-18 19:01:04 -07:00
ckh.c SC: Make some key size classes static. 2018-07-12 20:53:06 -07:00
ctl.c Add stats for the size of extent_avail heap 2018-08-02 10:16:06 -07:00
div.c Add the div module, which allows fast division by dynamic values. 2017-12-21 14:25:43 -08:00
extent_dss.c Hide size class computation behind a layer of indirection. 2018-07-12 20:53:06 -07:00
extent_mmap.c Header refactoring: unify and de-catchall extent_mmap module. 2017-05-31 13:08:45 -07:00
extent.c Add stats for the size of extent_avail heap 2018-08-02 10:16:06 -07:00
hash.c Header refactoring: Split up jemalloc_internal.h 2017-04-11 11:52:30 -07:00
hook.c Move tsd link and in_hook after tcache. 2018-06-27 13:39:02 -07:00
jemalloc_cpp.cpp Split out cold code path in newImpl 2017-07-24 13:37:02 -07:00
jemalloc.c malloc: Add a fastpath 2018-10-18 08:32:19 -07:00
large.c Add logging for sampled allocations 2018-08-01 13:27:11 -07:00
log.c Logging: allow logging with empty varargs. 2017-07-22 09:38:19 -07:00
malloc_io.c Fix type warning on Windows. 2018-04-09 16:50:30 -07:00
mutex_pool.c Header refactoring: unify and de-catchall mutex_pool. 2017-05-31 13:08:45 -07:00
mutex.c Clean compilation -Wextra 2018-07-09 21:40:42 -07:00
nstime.c Add background thread related stats. 2017-05-23 12:26:20 -07:00
pages.c check return value of malloc_read_fd 2018-10-11 17:25:20 -07:00
prng.c Header refactoring: Split up jemalloc_internal.h 2017-04-11 11:52:30 -07:00
prof.c restrict bytes_until_sample to int64_t. This allows optimal asm 2018-10-15 08:24:12 -07:00
rtree.c Clean compilation -Wextra 2018-07-09 21:40:42 -07:00
sc.c add a check for SC_LARGE_MAXCLASS 2018-10-15 08:24:12 -07:00
stats.c Add stats for the size of extent_avail heap 2018-08-02 10:16:06 -07:00
sz.c sz: Support 0 size in size2index lookup/compute 2018-10-17 08:50:58 -07:00
tcache.c SC: Make some key size classes static. 2018-07-12 20:53:06 -07:00
test_hooks.c Rename hooks module to test_hooks. 2018-05-18 11:43:03 -07:00
ticker.c Header refactoring: Split up jemalloc_internal.h 2017-04-11 11:52:30 -07:00
tsd.c remove malloc_init() off the fastpath 2018-10-15 10:11:08 -07:00
witness.c Header refactoring: unify and de-catchall witness code. 2017-05-24 15:27:30 -07:00
zone.c Fix deadlock in multithreaded fork in OS X. 2017-07-10 18:17:12 -07:00