diff options
author | Joerg Koenig <jck@techsat.com> | 2018-01-19 10:53:15 (GMT) |
---|---|---|
committer | Joerg Koenig <jck@techsat.com> | 2018-01-19 10:53:15 (GMT) |
commit | aa502047980c13cdbe5a1adb7f024199c367254d (patch) | |
tree | 8cc6a214bde51a42beb77ac92fe0d00dd44c0c90 /include/jemalloc/internal/rtree.h | |
parent | 3f5049340e66c6929c3270f7359617f62e053b11 (diff) | |
parent | f78d4ca3fbff6cab0c704c787706a53ddafcbe13 (diff) | |
download | jemalloc-master.zip jemalloc-master.tar.gz jemalloc-master.tar.bz2 |
Change-Id: I44881ca21f4710f7ad5154a45c4a7204ae71c84c
Diffstat (limited to 'include/jemalloc/internal/rtree.h')
-rw-r--r-- | include/jemalloc/internal/rtree.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/jemalloc/internal/rtree.h b/include/jemalloc/internal/rtree.h index b5d4db3..4563db2 100644 --- a/include/jemalloc/internal/rtree.h +++ b/include/jemalloc/internal/rtree.h @@ -178,9 +178,21 @@ rtree_leaf_elm_bits_read(tsdn_t *tsdn, rtree_t *rtree, rtree_leaf_elm_t *elm, JEMALLOC_ALWAYS_INLINE extent_t * rtree_leaf_elm_bits_extent_get(uintptr_t bits) { +# ifdef __aarch64__ + /* + * aarch64 doesn't sign extend the highest virtual address bit to set + * the higher ones. Instead, the high bits gets zeroed. + */ + uintptr_t high_bit_mask = ((uintptr_t)1 << LG_VADDR) - 1; + /* Mask off the slab bit. */ + uintptr_t low_bit_mask = ~(uintptr_t)1; + uintptr_t mask = high_bit_mask & low_bit_mask; + return (extent_t *)(bits & mask); +# else /* Restore sign-extended high bits, mask slab bit. */ return (extent_t *)((uintptr_t)((intptr_t)(bits << RTREE_NHIB) >> RTREE_NHIB) & ~((uintptr_t)0x1)); +# endif } JEMALLOC_ALWAYS_INLINE szind_t |