diff options
author | Jason Evans <jasone@canonware.com> | 2016-04-07 14:24:14 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2016-06-03 19:27:41 (GMT) |
commit | d78846c98978ea439c2514638de69be6d3d86a11 (patch) | |
tree | ddc390ab30410949969192467e3b78a08efb7ceb /include | |
parent | fae83440989e06c52acea0d06e70a4c27b9739f5 (diff) | |
download | jemalloc-d78846c98978ea439c2514638de69be6d3d86a11.zip jemalloc-d78846c98978ea439c2514638de69be6d3d86a11.tar.gz jemalloc-d78846c98978ea439c2514638de69be6d3d86a11.tar.bz2 |
Replace extent_achunk_[gs]et() with extent_slab_[gs]et().
Diffstat (limited to 'include')
-rw-r--r-- | include/jemalloc/internal/arena.h | 10 | ||||
-rw-r--r-- | include/jemalloc/internal/extent.h | 27 | ||||
-rw-r--r-- | include/jemalloc/internal/jemalloc_internal.h.in | 3 | ||||
-rw-r--r-- | include/jemalloc/internal/private_symbols.txt | 4 |
4 files changed, 22 insertions, 22 deletions
diff --git a/include/jemalloc/internal/arena.h b/include/jemalloc/internal/arena.h index ff3e01d..52e7197 100644 --- a/include/jemalloc/internal/arena.h +++ b/include/jemalloc/internal/arena.h @@ -1185,7 +1185,7 @@ arena_prof_tctx_get(tsdn_t *tsdn, const extent_t *extent, const void *ptr) cassert(config_prof); assert(ptr != NULL); - if (likely(extent_achunk_get(extent))) { + if (likely(extent_slab_get(extent))) { arena_chunk_t *chunk = (arena_chunk_t *)extent_addr_get(extent); size_t pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> LG_PAGE; size_t mapbits = arena_mapbits_get(chunk, pageind); @@ -1211,7 +1211,7 @@ arena_prof_tctx_set(tsdn_t *tsdn, extent_t *extent, const void *ptr, cassert(config_prof); assert(ptr != NULL); - if (likely(extent_achunk_get(extent))) { + if (likely(extent_slab_get(extent))) { arena_chunk_t *chunk = (arena_chunk_t *)extent_addr_get(extent); size_t pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> LG_PAGE; @@ -1331,7 +1331,7 @@ arena_salloc(tsdn_t *tsdn, const extent_t *extent, const void *ptr, bool demote) assert(ptr != NULL); - if (likely(extent_achunk_get(extent))) { + if (likely(extent_slab_get(extent))) { const arena_chunk_t *chunk = (const arena_chunk_t *)extent_addr_get(extent); @@ -1381,7 +1381,7 @@ arena_dalloc(tsdn_t *tsdn, extent_t *extent, void *ptr, tcache_t *tcache, assert(!tsdn_null(tsdn) || tcache == NULL); assert(ptr != NULL); - if (likely(extent_achunk_get(extent))) { + if (likely(extent_slab_get(extent))) { arena_chunk_t *chunk = (arena_chunk_t *)extent_addr_get(extent); pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> LG_PAGE; @@ -1428,7 +1428,7 @@ arena_sdalloc(tsdn_t *tsdn, extent_t *extent, void *ptr, size_t size, assert(!tsdn_null(tsdn) || tcache == NULL); - if (likely(extent_achunk_get(extent))) { + if (likely(extent_slab_get(extent))) { arena_chunk_t *chunk = (arena_chunk_t *)extent_addr_get(extent); if (config_prof && opt_prof) { diff --git a/include/jemalloc/internal/extent.h b/include/jemalloc/internal/extent.h index 33f5932..d7db49d 100644 --- a/include/jemalloc/internal/extent.h +++ b/include/jemalloc/internal/extent.h @@ -35,10 +35,11 @@ struct extent_s { bool e_committed; /* - * The achunk flag is used to validate that huge allocation lookups - * don't return arena chunks. + * The slab flag indicates whether the extent is used for a slab of + * small regions. This helps differentiate small size classes, and it + * indicates whether interior pointers can be looked up via iealloc(). */ - bool e_achunk; + bool e_slab; /* Profile counters, used for huge objects. */ prof_tctx_t *e_prof_tctx; @@ -79,7 +80,7 @@ size_t extent_size_get(const extent_t *extent); bool extent_active_get(const extent_t *extent); bool extent_zeroed_get(const extent_t *extent); bool extent_committed_get(const extent_t *extent); -bool extent_achunk_get(const extent_t *extent); +bool extent_slab_get(const extent_t *extent); prof_tctx_t *extent_prof_tctx_get(const extent_t *extent); void extent_arena_set(extent_t *extent, arena_t *arena); void extent_addr_set(extent_t *extent, void *addr); @@ -87,10 +88,10 @@ void extent_size_set(extent_t *extent, size_t size); void extent_active_set(extent_t *extent, bool active); void extent_zeroed_set(extent_t *extent, bool zeroed); void extent_committed_set(extent_t *extent, bool committed); -void extent_achunk_set(extent_t *extent, bool achunk); +void extent_slab_set(extent_t *extent, bool slab); void extent_prof_tctx_set(extent_t *extent, prof_tctx_t *tctx); void extent_init(extent_t *extent, arena_t *arena, void *addr, - size_t size, bool active, bool zeroed, bool committed); + size_t size, bool active, bool zeroed, bool committed, bool slab); void extent_dirty_insert(extent_t *extent, arena_runs_dirty_link_t *runs_dirty, extent_t *chunks_dirty); void extent_dirty_remove(extent_t *extent); @@ -136,15 +137,15 @@ JEMALLOC_INLINE bool extent_committed_get(const extent_t *extent) { - assert(!extent->e_achunk); + assert(!extent->e_slab); return (extent->e_committed); } JEMALLOC_INLINE bool -extent_achunk_get(const extent_t *extent) +extent_slab_get(const extent_t *extent) { - return (extent->e_achunk); + return (extent->e_slab); } JEMALLOC_INLINE prof_tctx_t * @@ -197,10 +198,10 @@ extent_committed_set(extent_t *extent, bool committed) } JEMALLOC_INLINE void -extent_achunk_set(extent_t *extent, bool achunk) +extent_slab_set(extent_t *extent, bool slab) { - extent->e_achunk = achunk; + extent->e_slab = slab; } JEMALLOC_INLINE void @@ -212,7 +213,7 @@ extent_prof_tctx_set(extent_t *extent, prof_tctx_t *tctx) JEMALLOC_INLINE void extent_init(extent_t *extent, arena_t *arena, void *addr, size_t size, - bool active, bool zeroed, bool committed) + bool active, bool zeroed, bool committed, bool slab) { extent_arena_set(extent, arena); @@ -221,7 +222,7 @@ extent_init(extent_t *extent, arena_t *arena, void *addr, size_t size, extent_active_set(extent, active); extent_zeroed_set(extent, zeroed); extent_committed_set(extent, committed); - extent_achunk_set(extent, false); + extent_slab_set(extent, slab); if (config_prof) extent_prof_tctx_set(extent, NULL); qr_new(&extent->rd, rd_link); diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in index a7f0781..7afe569 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -1095,8 +1095,7 @@ ivsalloc(tsdn_t *tsdn, const void *ptr, bool demote) return (0); assert(extent_active_get(extent)); /* Only arena chunks should be looked up via interior pointers. */ - assert(extent_addr_get(extent) == ptr || - extent_achunk_get(extent)); + assert(extent_addr_get(extent) == ptr || extent_slab_get(extent)); return (isalloc(tsdn, extent, ptr, demote)); } diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt index 1940246..23c206b 100644 --- a/include/jemalloc/internal/private_symbols.txt +++ b/include/jemalloc/internal/private_symbols.txt @@ -205,8 +205,6 @@ ctl_postfork_parent ctl_prefork decay_ticker_get dss_prec_names -extent_achunk_get -extent_achunk_set extent_active_get extent_active_set extent_addr_get @@ -222,6 +220,8 @@ extent_prof_tctx_get extent_prof_tctx_set extent_size_get extent_size_set +extent_slab_get +extent_slab_set extent_tree_ad_destroy extent_tree_ad_destroy_recurse extent_tree_ad_empty |