diff options
author | Daniel Micay <danielmicay@gmail.com> | 2014-10-23 10:30:52 -0400 |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2014-10-30 17:06:38 -0700 |
commit | 809b0ac3919da60c20ad59517ef560d0df639f3b (patch) | |
tree | e012217d815bd24e5869d33c9b5886fc9db549c0 /include/jemalloc/internal/prof.h | |
parent | c93ed81cd06ae46906ae7a386fd6312caca391fb (diff) | |
download | jemalloc-809b0ac3919da60c20ad59517ef560d0df639f3b.tar.gz |
mark huge allocations as unlikely
This cleans up the fast path a bit more by moving away more code.
Diffstat (limited to 'include/jemalloc/internal/prof.h')
-rw-r--r-- | include/jemalloc/internal/prof.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/jemalloc/internal/prof.h b/include/jemalloc/internal/prof.h index 5103146..e0d5f10 100644 --- a/include/jemalloc/internal/prof.h +++ b/include/jemalloc/internal/prof.h @@ -361,7 +361,7 @@ prof_tctx_get(const void *ptr) assert(ptr != NULL); chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) { + if (likely(chunk != ptr)) { /* Region. */ ret = arena_prof_tctx_get(ptr); } else @@ -379,7 +379,7 @@ prof_tctx_set(const void *ptr, prof_tctx_t *tctx) assert(ptr != NULL); chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) { + if (likely(chunk != ptr)) { /* Region. */ arena_prof_tctx_set(ptr, tctx); } else |