diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/rtl/alloc_arena.cxx | 8 | ||||
-rw-r--r-- | sal/rtl/alloc_cache.cxx | 4 | ||||
-rw-r--r-- | sal/rtl/alloc_impl.hxx | 8 |
3 files changed, 9 insertions, 11 deletions
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx index 74254ee15451..19bc4241b3b0 100644 --- a/sal/rtl/alloc_arena.cxx +++ b/sal/rtl/alloc_arena.cxx @@ -428,8 +428,8 @@ rtl_arena_segment_alloc ( assert(*ppSegment == nullptr); if (!RTL_MEMORY_ISP2(size)) { - int msb = highbit(size); - if (RTL_ARENA_FREELIST_SIZE == sal::static_int_cast< size_t >(msb)) + unsigned int msb = highbit(size); + if (RTL_ARENA_FREELIST_SIZE == msb) { /* highest possible freelist: fall back to first fit */ rtl_arena_segment_type *head, *segment; @@ -660,9 +660,7 @@ rtl_arena_destructor (void * obj) assert(arena->m_hash_table == arena->m_hash_table_0); assert(arena->m_hash_size == RTL_ARENA_HASH_SIZE); - assert( - arena->m_hash_shift == - sal::static_int_cast< unsigned >(highbit(arena->m_hash_size) - 1)); + assert(arena->m_hash_shift == highbit(arena->m_hash_size) - 1); } /* ================================================================= */ diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx index d91908879c70..29d20080c084 100644 --- a/sal/rtl/alloc_cache.cxx +++ b/sal/rtl/alloc_cache.cxx @@ -767,7 +767,7 @@ rtl_cache_destructor (void * obj) assert(cache->m_hash_table == cache->m_hash_table_0); assert(cache->m_hash_size == RTL_CACHE_HASH_SIZE); - assert(cache->m_hash_shift == (sal_Size)(highbit(cache->m_hash_size) - 1)); + assert(cache->m_hash_shift == highbit(cache->m_hash_size) - 1); /* depot layer */ (void)RTL_MEMORY_LOCK_DESTROY(&(cache->m_depot_lock)); @@ -838,7 +838,7 @@ rtl_cache_activate ( if (flags & RTL_CACHE_FLAG_QUANTUMCACHE) { /* next power of 2 above 3 * qcache_max */ - if(slabsize < (((sal_Size)1) << highbit(3 * source->m_qcache_max))) + if (slabsize < (((sal_Size)1) << highbit(3 * source->m_qcache_max))) { slabsize = (((sal_Size)1) << highbit(3 * source->m_qcache_max)); } diff --git a/sal/rtl/alloc_impl.hxx b/sal/rtl/alloc_impl.hxx index d10ba930c57e..fada22718d43 100644 --- a/sal/rtl/alloc_impl.hxx +++ b/sal/rtl/alloc_impl.hxx @@ -65,10 +65,10 @@ /** highbit(): log2() + 1 * (complexity O(1)) */ -static inline int +static inline unsigned int highbit(sal_Size n) { - int k = 1; + unsigned int k = 1; if (n == 0) return 0; @@ -108,10 +108,10 @@ highbit(sal_Size n) /** lowbit(): find first bit set * (complexity O(1)) */ -static inline int +static inline unsigned int lowbit(sal_Size n) { - int k = 1; + unsigned int k = 1; if (n == 0) return 0; |