summaryrefslogtreecommitdiffstats
path: root/src/base.c
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2019-04-03 00:50:42 (GMT)
committerQi Wang <interwq@gwu.edu>2019-04-03 00:50:42 (GMT)
commitb0b3e49a54ec29e32636f4577d9d5a896d67fd20 (patch)
treee80fd5feaedd401e7e2c884e73f8c884f51b5a65 /src/base.c
parent61efbda7098de6fe64c362d309824864308c36d4 (diff)
parentf7489dc8f1fac233b0cd4e40331de8b738b1f2e2 (diff)
downloadjemalloc-5.2.0.zip
jemalloc-5.2.0.tar.gz
jemalloc-5.2.0.tar.bz2
Merge branch 'dev'5.2.0
Diffstat (limited to 'src/base.c')
-rw-r--r--src/base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/base.c b/src/base.c
index b0324b5..f3c6166 100644
--- a/src/base.c
+++ b/src/base.c
@@ -262,8 +262,8 @@ base_block_alloc(tsdn_t *tsdn, base_t *base, extent_hooks_t *extent_hooks,
*/
size_t min_block_size = HUGEPAGE_CEILING(sz_psz2u(header_size + gap_size
+ usize));
- pszind_t pind_next = (*pind_last + 1 < NPSIZES) ? *pind_last + 1 :
- *pind_last;
+ pszind_t pind_next = (*pind_last + 1 < sz_psz2ind(SC_LARGE_MAXCLASS)) ?
+ *pind_last + 1 : *pind_last;
size_t next_block_size = HUGEPAGE_CEILING(sz_pind2sz(pind_next));
size_t block_size = (min_block_size > next_block_size) ? min_block_size
: next_block_size;
@@ -372,7 +372,7 @@ base_new(tsdn_t *tsdn, unsigned ind, extent_hooks_t *extent_hooks) {
base->extent_sn_next = extent_sn_next;
base->blocks = block;
base->auto_thp_switched = false;
- for (szind_t i = 0; i < NSIZES; i++) {
+ for (szind_t i = 0; i < SC_NSIZES; i++) {
extent_heap_new(&base->avail[i]);
}
if (config_stats) {
@@ -426,7 +426,7 @@ base_alloc_impl(tsdn_t *tsdn, base_t *base, size_t size, size_t alignment,
extent_t *extent = NULL;
malloc_mutex_lock(tsdn, &base->mtx);
- for (szind_t i = sz_size2index(asize); i < NSIZES; i++) {
+ for (szind_t i = sz_size2index(asize); i < SC_NSIZES; i++) {
extent = extent_heap_remove_first(&base->avail[i]);
if (extent != NULL) {
/* Use existing space. */