diff options
author | Jason Evans <jasone@canonware.com> | 2016-03-28 10:17:10 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2016-06-03 19:27:41 (GMT) |
commit | fae83440989e06c52acea0d06e70a4c27b9739f5 (patch) | |
tree | 4af519073a04094003892fe13a26efbb78985538 /include | |
parent | 6f718446596c83cadc3fa53625953291655bfcdf (diff) | |
download | jemalloc-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 'include')
-rw-r--r-- | include/jemalloc/internal/extent.h | 31 | ||||
-rw-r--r-- | include/jemalloc/internal/jemalloc_internal.h.in | 1 | ||||
-rw-r--r-- | include/jemalloc/internal/private_symbols.txt | 3 |
3 files changed, 25 insertions, 10 deletions
diff --git a/include/jemalloc/internal/extent.h b/include/jemalloc/internal/extent.h index acc67f0..33f5932 100644 --- a/include/jemalloc/internal/extent.h +++ b/include/jemalloc/internal/extent.h @@ -18,6 +18,9 @@ struct extent_s { /* Total region size. */ size_t e_size; + /* True if extent is active (in use). */ + bool e_active; + /* * The zeroed flag is used by chunk recycling code to track whether * memory is zero-filled. @@ -73,6 +76,7 @@ rb_proto(, extent_tree_ad_, extent_tree_t, extent_t) arena_t *extent_arena_get(const extent_t *extent); void *extent_addr_get(const extent_t *extent); 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); @@ -80,13 +84,13 @@ 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); 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_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 zeroed, bool committed); -void extent_dirty_linkage_init(extent_t *extent); + size_t size, bool active, bool zeroed, bool committed); 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); @@ -115,6 +119,13 @@ extent_size_get(const extent_t *extent) } JEMALLOC_INLINE bool +extent_active_get(const extent_t *extent) +{ + + return (extent->e_active); +} + +JEMALLOC_INLINE bool extent_zeroed_get(const extent_t *extent) { @@ -165,6 +176,13 @@ extent_size_set(extent_t *extent, size_t size) } JEMALLOC_INLINE void +extent_active_set(extent_t *extent, bool active) +{ + + extent->e_active = active; +} + +JEMALLOC_INLINE void extent_zeroed_set(extent_t *extent, bool zeroed) { @@ -194,23 +212,18 @@ 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 zeroed, bool committed) + bool active, bool zeroed, bool committed) { extent_arena_set(extent, arena); extent_addr_set(extent, addr); extent_size_set(extent, size); + extent_active_set(extent, active); extent_zeroed_set(extent, zeroed); extent_committed_set(extent, committed); extent_achunk_set(extent, false); if (config_prof) extent_prof_tctx_set(extent, NULL); -} - -JEMALLOC_INLINE void -extent_dirty_linkage_init(extent_t *extent) -{ - qr_new(&extent->rd, rd_link); qr_new(extent, cc_link); } diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in index c7d9737..a7f0781 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -1093,6 +1093,7 @@ ivsalloc(tsdn_t *tsdn, const void *ptr, bool demote) extent = chunk_lookup(tsdn, ptr, false); if (extent == NULL) 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)); diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt index 102f01c..1940246 100644 --- a/include/jemalloc/internal/private_symbols.txt +++ b/include/jemalloc/internal/private_symbols.txt @@ -207,6 +207,8 @@ decay_ticker_get dss_prec_names extent_achunk_get extent_achunk_set +extent_active_get +extent_active_set extent_addr_get extent_addr_set extent_arena_get @@ -214,7 +216,6 @@ extent_arena_set extent_committed_get extent_committed_set extent_dirty_insert -extent_dirty_linkage_init extent_dirty_remove extent_init extent_prof_tctx_get |