diff options
| author | Jason Evans <jasone@canonware.com> | 2017-02-05 10:50:59 (GMT) |
|---|---|---|
| committer | Jason Evans <jasone@canonware.com> | 2017-02-09 02:50:03 (GMT) |
| commit | 650c070e102daeedd643dc79b463603a1ea18497 (patch) | |
| tree | c21fd233c4d260013e8df9191b7d670af7cec403 /src | |
| parent | f5cf9b19c85f88ee91b3caf65e2a6d70f4548f31 (diff) | |
| download | jemalloc-650c070e102daeedd643dc79b463603a1ea18497.zip jemalloc-650c070e102daeedd643dc79b463603a1ea18497.tar.gz jemalloc-650c070e102daeedd643dc79b463603a1ea18497.tar.bz2 | |
Remove rtree support for 0 (NULL) keys.
NULL can never actually be inserted in practice, and removing support
allows a branch to be removed from the fast path.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rtree.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/rtree.c b/src/rtree.c index 83929ba..a86fa45 100644 --- a/src/rtree.c +++ b/src/rtree.c @@ -170,17 +170,15 @@ rtree_elm_lookup_hard(tsdn_t *tsdn, rtree_t *rtree, rtree_ctx_t *rtree_ctx, * node is a leaf, so it contains values rather than \ * child pointers. \ */ \ - if (likely(key != 0)) { \ - if (RTREE_CTX_NCACHE > 1) { \ - memmove(&rtree_ctx->cache[1], \ - &rtree_ctx->cache[0], \ - sizeof(rtree_ctx_cache_elm_t) * \ - (RTREE_CTX_NCACHE-1)); \ - } \ - uintptr_t leafkey = rtree_leafkey(key); \ - rtree_ctx->cache[0].leafkey = leafkey; \ - rtree_ctx->cache[0].leaf = node; \ + if (RTREE_CTX_NCACHE > 1) { \ + memmove(&rtree_ctx->cache[1], \ + &rtree_ctx->cache[0], \ + sizeof(rtree_ctx_cache_elm_t) * \ + (RTREE_CTX_NCACHE-1)); \ } \ + uintptr_t leafkey = rtree_leafkey(key); \ + rtree_ctx->cache[0].leafkey = leafkey; \ + rtree_ctx->cache[0].leaf = node; \ uintptr_t subkey = rtree_subkey(key, level); \ return &node[subkey]; \ } |
