diff options
author | Jason Evans <jasone@canonware.com> | 2015-01-31 05:21:16 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2015-02-05 00:51:53 (GMT) |
commit | 918a1a5b3f09cb456c25be9a2555a8fea6a9bb94 (patch) | |
tree | 69a40baed20131e133910d0bcc5a2bbe082d8918 /include/jemalloc | |
parent | a55dfa4b0af68f372782e130031483ad73cf7eec (diff) | |
download | jemalloc-918a1a5b3f09cb456c25be9a2555a8fea6a9bb94.zip jemalloc-918a1a5b3f09cb456c25be9a2555a8fea6a9bb94.tar.gz jemalloc-918a1a5b3f09cb456c25be9a2555a8fea6a9bb94.tar.bz2 |
Reduce extent_node_t size to fit in one cache line.
Diffstat (limited to 'include/jemalloc')
-rw-r--r-- | include/jemalloc/internal/extent.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/jemalloc/internal/extent.h b/include/jemalloc/internal/extent.h index cbfc20a..f45940c 100644 --- a/include/jemalloc/internal/extent.h +++ b/include/jemalloc/internal/extent.h @@ -15,9 +15,6 @@ struct extent_node_s { /* Linkage for the address-ordered tree. */ rb_node(extent_node_t) link_ad; - /* Profile counters, used for huge objects. */ - prof_tctx_t *prof_tctx; - /* Pointer to the extent that this tree node is responsible for. */ void *addr; @@ -27,8 +24,17 @@ struct extent_node_s { /* Arena from which this extent came, if any. */ arena_t *arena; - /* True if zero-filled; used by chunk recycling code. */ - bool zeroed; + /* + * 'prof_tctx' and 'zeroed' are never needed at the same time, so + * overlay them in order to fit extent_node_t in one cache line. + */ + union { + /* Profile counters, used for huge objects. */ + prof_tctx_t *prof_tctx; + + /* True if zero-filled; used by chunk recycling code. */ + bool zeroed; + }; }; typedef rb_tree(extent_node_t) extent_tree_t; |