diff options
author | jackpoz <giacomopoz@gmail.com> | 2017-11-19 11:23:41 +0100 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2017-11-19 19:22:41 +0100 |
commit | cc6dec72863a771da0c0f3ab3d32f75d7ce863bd (patch) | |
tree | 5386204cdcc3ed9844b38986e3a45bf5613748c5 /dep/jemalloc/src/bitmap.c | |
parent | 11beb4b6e1e63156774a42e5cfc63f17bdccc3ad (diff) |
Dep/Jemalloc: Update to Jemalloc 4.0.4
Diffstat (limited to 'dep/jemalloc/src/bitmap.c')
-rw-r--r-- | dep/jemalloc/src/bitmap.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/dep/jemalloc/src/bitmap.c b/dep/jemalloc/src/bitmap.c index e2bd907d558..c733372b4cb 100644 --- a/dep/jemalloc/src/bitmap.c +++ b/dep/jemalloc/src/bitmap.c @@ -2,19 +2,6 @@ #include "jemalloc/internal/jemalloc_internal.h" /******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -static size_t bits2groups(size_t nbits); - -/******************************************************************************/ - -static size_t -bits2groups(size_t nbits) -{ - - return ((nbits >> LG_BITMAP_GROUP_NBITS) + - !!(nbits & BITMAP_GROUP_NBITS_MASK)); -} void bitmap_info_init(bitmap_info_t *binfo, size_t nbits) @@ -31,15 +18,16 @@ bitmap_info_init(bitmap_info_t *binfo, size_t nbits) * that requires only one group. */ binfo->levels[0].group_offset = 0; - group_count = bits2groups(nbits); + group_count = BITMAP_BITS2GROUPS(nbits); for (i = 1; group_count > 1; i++) { assert(i < BITMAP_MAX_LEVELS); binfo->levels[i].group_offset = binfo->levels[i-1].group_offset + group_count; - group_count = bits2groups(group_count); + group_count = BITMAP_BITS2GROUPS(group_count); } binfo->levels[i].group_offset = binfo->levels[i-1].group_offset + group_count; + assert(binfo->levels[i].group_offset <= BITMAP_GROUPS_MAX); binfo->nlevels = i; binfo->nbits = nbits; } |