diff options
author | Jason Evans <je@fb.com> | 2012-02-13 20:29:49 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2012-02-13 20:29:49 (GMT) |
commit | 962463d9b57bcc65de2fa108a691b4183b9b2faf (patch) | |
tree | d9d5d6117b764f9017cd6595f33a11990475f2aa /src/arena.c | |
parent | 4162627757889ea999264c2ddbc3c354768774e2 (diff) | |
download | jemalloc-962463d9b57bcc65de2fa108a691b4183b9b2faf.zip jemalloc-962463d9b57bcc65de2fa108a691b4183b9b2faf.tar.gz jemalloc-962463d9b57bcc65de2fa108a691b4183b9b2faf.tar.bz2 |
Streamline tcache-related malloc/free fast paths.
tcache_get() is inlined, so do the config_tcache check inside
tcache_get() and simplify its callers.
Make arena_malloc() an inline function, since it is part of the malloc()
fast path.
Remove conditional logic that cause build issues if --disable-tcache was
specified.
Diffstat (limited to 'src/arena.c')
-rw-r--r-- | src/arena.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/arena.c b/src/arena.c index c2632d9..8a158df 100644 --- a/src/arena.c +++ b/src/arena.c @@ -1455,35 +1455,6 @@ arena_malloc_large(arena_t *arena, size_t size, bool zero) return (ret); } -void * -arena_malloc(size_t size, bool zero) -{ - - assert(size != 0); - assert(QUANTUM_CEILING(size) <= arena_maxclass); - - if (size <= small_maxclass) { - tcache_t *tcache; - - if (config_tcache && (tcache = tcache_get()) != NULL) - return (tcache_alloc_small(tcache, size, zero)); - else - return (arena_malloc_small(choose_arena(), size, zero)); - } else { - if (config_tcache && size <= tcache_maxclass) { - tcache_t *tcache; - - if ((tcache = tcache_get()) != NULL) - return (tcache_alloc_large(tcache, size, zero)); - else { - return (arena_malloc_large(choose_arena(), - size, zero)); - } - } else - return (arena_malloc_large(choose_arena(), size, zero)); - } -} - /* Only handles large allocations that require more than page alignment. */ void * arena_palloc(arena_t *arena, size_t size, size_t alloc_size, size_t alignment, |