aboutsummaryrefslogtreecommitdiff
path: root/dep/jemalloc/src/bitmap.c
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2017-11-19 11:23:41 +0100
committerfunjoker <funjoker109@gmail.com>2021-02-15 19:13:25 +0100
commit367e9f210eb5ec852458f65ec967497d919afd7a (patch)
treef8a51b3d5260fbf3e7e941397ad49fa735951991 /dep/jemalloc/src/bitmap.c
parenta9edd9dc47afc56ee0a4b8e9f2be2823e861903f (diff)
Dep/Jemalloc: Update to Jemalloc 4.0.4
(cherry picked from commit cc6dec72863a771da0c0f3ab3d32f75d7ce863bd)
Diffstat (limited to 'dep/jemalloc/src/bitmap.c')
-rw-r--r--dep/jemalloc/src/bitmap.c18
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;
}