diff options
author | Jason Evans <je@fb.com> | 2012-02-11 04:22:09 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2012-02-11 04:22:09 (GMT) |
commit | 7372b15a31c63ac5cb9ed8aeabc2a0a3c005e8bf (patch) | |
tree | 9b0f1156e6aa61f50a01c90b72fdaefeabe414a8 /src/extent.c | |
parent | b3bd885090230cc28add77c399b4ed440b760ca3 (diff) | |
download | jemalloc-7372b15a31c63ac5cb9ed8aeabc2a0a3c005e8bf.zip jemalloc-7372b15a31c63ac5cb9ed8aeabc2a0a3c005e8bf.tar.gz jemalloc-7372b15a31c63ac5cb9ed8aeabc2a0a3c005e8bf.tar.bz2 |
Reduce cpp conditional logic complexity.
Convert configuration-related cpp conditional logic to use static
constant variables, e.g.:
#ifdef JEMALLOC_DEBUG
[...]
#endif
becomes:
if (config_debug) {
[...]
}
The advantage is clearer, more concise code. The main disadvantage is
that data structures no longer have conditionally defined fields, so
they pay the cost of all fields regardless of whether they are used. In
practice, this is only a minor concern; config_stats will go away in an
upcoming change, and config_prof is the only other major feature that
depends on more than a few special-purpose fields.
Diffstat (limited to 'src/extent.c')
-rw-r--r-- | src/extent.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/extent.c b/src/extent.c index 3c04d3a..8c09b48 100644 --- a/src/extent.c +++ b/src/extent.c @@ -3,7 +3,6 @@ /******************************************************************************/ -#if (defined(JEMALLOC_SWAP) || defined(JEMALLOC_DSS)) static inline int extent_szad_comp(extent_node_t *a, extent_node_t *b) { @@ -25,7 +24,6 @@ extent_szad_comp(extent_node_t *a, extent_node_t *b) /* Generate red-black tree functions. */ rb_gen(, extent_tree_szad_, extent_tree_t, extent_node_t, link_szad, extent_szad_comp) -#endif static inline int extent_ad_comp(extent_node_t *a, extent_node_t *b) |