aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-03-22 17:54:35 -0700
committerJason Evans <jasone@canonware.com>2016-03-22 17:54:35 -0700
commit6c460ad91bf349ebac3b23e58d97769a982110fe (patch)
tree0659c384b00957993e1edf2f71cbbf6f74ecc7bc /src
parent18903c592fdbf2384b59051bd251d234e84647af (diff)
downloadjemalloc-6c460ad91bf349ebac3b23e58d97769a982110fe.tar.gz
Optimize rtree_get().
Specialize fast path to avoid code that cannot execute for dependent loads. Manually unroll.
Diffstat (limited to 'src')
-rw-r--r--src/rtree.c2
-rw-r--r--src/util.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/rtree.c b/src/rtree.c
index af0d97e..3166b45 100644
--- a/src/rtree.c
+++ b/src/rtree.c
@@ -15,6 +15,8 @@ rtree_new(rtree_t *rtree, unsigned bits, rtree_node_alloc_t *alloc,
{
unsigned bits_in_leaf, height, i;
+ assert(RTREE_HEIGHT_MAX == ((ZU(1) << (LG_SIZEOF_PTR+3)) /
+ RTREE_BITS_PER_LEVEL));
assert(bits > 0 && bits <= (sizeof(uintptr_t) << 3));
bits_in_leaf = (bits % RTREE_BITS_PER_LEVEL) == 0 ? RTREE_BITS_PER_LEVEL
diff --git a/src/util.c b/src/util.c
index 982a2e3..581d540 100644
--- a/src/util.c
+++ b/src/util.c
@@ -14,6 +14,7 @@
malloc_write("<jemalloc>: Unreachable code reached\n"); \
abort(); \
} \
+ unreachable(); \
} while (0)
#define not_implemented() do { \