summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-03-28 10:17:10 (GMT)
committerJason Evans <jasone@canonware.com>2016-06-03 19:27:41 (GMT)
commitfae83440989e06c52acea0d06e70a4c27b9739f5 (patch)
tree4af519073a04094003892fe13a26efbb78985538 /src
parent6f718446596c83cadc3fa53625953291655bfcdf (diff)
downloadjemalloc-fae83440989e06c52acea0d06e70a4c27b9739f5.zip
jemalloc-fae83440989e06c52acea0d06e70a4c27b9739f5.tar.gz
jemalloc-fae83440989e06c52acea0d06e70a4c27b9739f5.tar.bz2
Add extent_active_[gs]et().
Always initialize extents' runs_dirty and chunks_cache linkage.
Diffstat (limited to 'src')
-rw-r--r--src/arena.c6
-rw-r--r--src/base.c4
-rw-r--r--src/chunk.c11
-rw-r--r--src/huge.c2
4 files changed, 12 insertions, 11 deletions
diff --git a/src/arena.c b/src/arena.c
index 8a93fca..5a4605d 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -225,7 +225,6 @@ arena_chunk_cache_maybe_insert(arena_t *arena, extent_t *extent, bool cache)
{
if (cache) {
- extent_dirty_linkage_init(extent);
extent_dirty_insert(extent, &arena->runs_dirty,
&arena->chunks_cache);
arena->ndirty += arena_chunk_dirty_npages(extent);
@@ -526,7 +525,7 @@ arena_chunk_register(tsdn_t *tsdn, arena_t *arena, arena_chunk_t *chunk,
* runs is tracked individually, and upon chunk deallocation the entire
* chunk is in a consistent commit state.
*/
- extent_init(&chunk->extent, arena, chunk, chunksize, zero, true);
+ extent_init(&chunk->extent, arena, chunk, chunksize, true, zero, true);
extent_achunk_set(&chunk->extent, true);
return (chunk_register(tsdn, chunk, &chunk->extent));
}
@@ -1723,7 +1722,8 @@ arena_purge_to_limit(tsdn_t *tsdn, arena_t *arena, size_t ndirty_limit)
arena->lg_dirty_mult) < arena->ndirty || ndirty_limit == 0);
qr_new(&purge_runs_sentinel, rd_link);
- extent_dirty_linkage_init(&purge_chunks_sentinel);
+ extent_init(&purge_chunks_sentinel, arena, NULL, 0, false, false,
+ false);
npurge = arena_stash_dirty(tsdn, arena, &chunk_hooks, ndirty_limit,
&purge_runs_sentinel, &purge_chunks_sentinel);
diff --git a/src/base.c b/src/base.c
index a9ab279..0176fb8 100644
--- a/src/base.c
+++ b/src/base.c
@@ -66,7 +66,7 @@ base_chunk_alloc(tsdn_t *tsdn, size_t minsize)
base_resident += PAGE_CEILING(nsize);
}
}
- extent_init(extent, NULL, addr, csize, true, true);
+ extent_init(extent, NULL, addr, csize, true, true, true);
return (extent);
}
@@ -90,7 +90,7 @@ base_alloc(tsdn_t *tsdn, size_t size)
csize = CACHELINE_CEILING(size);
usize = s2u(csize);
- extent_init(&key, NULL, NULL, usize, false, false);
+ extent_init(&key, NULL, NULL, usize, false, false, false);
malloc_mutex_lock(tsdn, &base_mtx);
extent = extent_tree_szad_nsearch(&base_avail_szad, &key);
if (extent != NULL) {
diff --git a/src/chunk.c b/src/chunk.c
index beef41f..055b4fc 100644
--- a/src/chunk.c
+++ b/src/chunk.c
@@ -239,7 +239,7 @@ chunk_first_best_fit(arena_t *arena, extent_tree_t *chunks_szad,
assert(size == CHUNK_CEILING(size));
- extent_init(&key, arena, NULL, size, false, false);
+ extent_init(&key, arena, NULL, size, false, false, false);
return (extent_tree_szad_nsearch(chunks_szad, &key));
}
@@ -270,7 +270,8 @@ chunk_recycle(tsdn_t *tsdn, arena_t *arena, chunk_hooks_t *chunk_hooks,
chunk_hooks_assure_initialized_locked(tsdn, arena, chunk_hooks);
if (new_addr != NULL) {
extent_t key;
- extent_init(&key, arena, new_addr, alloc_size, false, false);
+ extent_init(&key, arena, new_addr, alloc_size, false, false,
+ false);
extent = extent_tree_ad_search(chunks_ad, &key);
} else {
extent = chunk_first_best_fit(arena, chunks_szad, chunks_ad,
@@ -336,7 +337,7 @@ chunk_recycle(tsdn_t *tsdn, arena_t *arena, chunk_hooks_t *chunk_hooks,
}
}
extent_init(extent, arena, (void *)((uintptr_t)(ret) + size),
- trailsize, zeroed, committed);
+ trailsize, false, zeroed, committed);
extent_tree_szad_insert(chunks_szad, extent);
extent_tree_ad_insert(chunks_ad, extent);
arena_chunk_cache_maybe_insert(arena, extent, cache);
@@ -534,7 +535,7 @@ chunk_record(tsdn_t *tsdn, arena_t *arena, chunk_hooks_t *chunk_hooks,
malloc_mutex_lock(tsdn, &arena->chunks_mtx);
chunk_hooks_assure_initialized_locked(tsdn, arena, chunk_hooks);
extent_init(&key, arena, (void *)((uintptr_t)chunk + size), 0, false,
- false);
+ false, false);
extent = extent_tree_ad_nsearch(chunks_ad, &key);
/* Try to coalesce forward. */
if (extent != NULL && extent_addr_get(extent) == extent_addr_get(&key)
@@ -570,7 +571,7 @@ chunk_record(tsdn_t *tsdn, arena_t *arena, chunk_hooks_t *chunk_hooks,
}
goto label_return;
}
- extent_init(extent, arena, chunk, size, !unzeroed,
+ extent_init(extent, arena, chunk, size, false, !unzeroed,
committed);
extent_tree_ad_insert(chunks_ad, extent);
extent_tree_szad_insert(chunks_szad, extent);
diff --git a/src/huge.c b/src/huge.c
index 0b91c36..b6ad4ba 100644
--- a/src/huge.c
+++ b/src/huge.c
@@ -50,7 +50,7 @@ huge_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment,
return (NULL);
}
- extent_init(extent, arena, ret, usize, is_zeroed, true);
+ extent_init(extent, arena, ret, usize, true, is_zeroed, true);
if (chunk_register(tsdn, ret, extent)) {
arena_chunk_dalloc_huge(tsdn, arena, ret, usize);