diff options
author | Jason Evans <jasone@canonware.com> | 2015-02-17 23:13:52 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2015-02-17 23:13:52 (GMT) |
commit | a4e1888d1a12d864f42350f2859e33eb3a0033f2 (patch) | |
tree | f041c1a61d14e28b55369b77f9065d1ece44628c /include/jemalloc | |
parent | ee41ad409a43d12900a5a3108f6c14f84e4eb0eb (diff) | |
download | jemalloc-a4e1888d1a12d864f42350f2859e33eb3a0033f2.zip jemalloc-a4e1888d1a12d864f42350f2859e33eb3a0033f2.tar.gz jemalloc-a4e1888d1a12d864f42350f2859e33eb3a0033f2.tar.bz2 |
Simplify extent_node_t and add extent_node_init().
Diffstat (limited to 'include/jemalloc')
-rw-r--r-- | include/jemalloc/internal/extent.h | 35 | ||||
-rw-r--r-- | include/jemalloc/internal/private_symbols.txt | 1 |
2 files changed, 23 insertions, 13 deletions
diff --git a/include/jemalloc/internal/extent.h b/include/jemalloc/internal/extent.h index 1060761..9ee1b44 100644 --- a/include/jemalloc/internal/extent.h +++ b/include/jemalloc/internal/extent.h @@ -30,19 +30,12 @@ struct extent_node_s { */ bool en_achunk; - union { - /* Profile counters, used for huge objects. */ - prof_tctx_t *en_prof_tctx; - - struct { - /* - * Linkage for arena's runs_dirty and chunks_dirty - * rings. - */ - qr(extent_node_t) cd_link; - arena_chunk_map_misc_t runs_dirty; - }; - }; + /* Profile counters, used for huge objects. */ + prof_tctx_t *en_prof_tctx; + + /* Linkage for arena's runs_dirty and chunks_dirty rings. */ + qr(extent_node_t) cd_link; + arena_chunk_map_misc_t runs_dirty; union { /* Linkage for the size/address-ordered tree. */ @@ -82,6 +75,8 @@ void extent_node_size_set(extent_node_t *node, size_t size); void extent_node_zeroed_set(extent_node_t *node, bool zeroed); void extent_node_achunk_set(extent_node_t *node, bool achunk); void extent_node_prof_tctx_set(extent_node_t *node, prof_tctx_t *tctx); +void extent_node_init(extent_node_t *node, arena_t *arena, void *addr, + size_t size, bool zeroed); #endif #if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_EXTENT_C_)) @@ -168,6 +163,20 @@ extent_node_prof_tctx_set(extent_node_t *node, prof_tctx_t *tctx) node->en_prof_tctx = tctx; } + +JEMALLOC_INLINE void +extent_node_init(extent_node_t *node, arena_t *arena, void *addr, size_t size, + bool zeroed) +{ + + extent_node_arena_set(node, arena); + extent_node_addr_set(node, addr); + extent_node_size_set(node, size); + extent_node_zeroed_set(node, zeroed); + extent_node_achunk_set(node, false); + if (config_prof) + extent_node_prof_tctx_set(node, NULL); +} #endif #endif /* JEMALLOC_H_INLINES */ diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt index a1d12cf..8b55954 100644 --- a/include/jemalloc/internal/private_symbols.txt +++ b/include/jemalloc/internal/private_symbols.txt @@ -182,6 +182,7 @@ extent_node_addr_get extent_node_addr_set extent_node_arena_get extent_node_arena_set +extent_node_init extent_node_prof_tctx_get extent_node_prof_tctx_set extent_node_size_get |