summaryrefslogtreecommitdiffstats
path: root/include/jemalloc/internal/ckh.h
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2012-02-11 04:22:09 (GMT)
committerJason Evans <je@fb.com>2012-02-11 04:22:09 (GMT)
commit7372b15a31c63ac5cb9ed8aeabc2a0a3c005e8bf (patch)
tree9b0f1156e6aa61f50a01c90b72fdaefeabe414a8 /include/jemalloc/internal/ckh.h
parentb3bd885090230cc28add77c399b4ed440b760ca3 (diff)
downloadjemalloc-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 'include/jemalloc/internal/ckh.h')
-rw-r--r--include/jemalloc/internal/ckh.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/include/jemalloc/internal/ckh.h b/include/jemalloc/internal/ckh.h
index 3e4ad4c..28f171c 100644
--- a/include/jemalloc/internal/ckh.h
+++ b/include/jemalloc/internal/ckh.h
@@ -30,10 +30,8 @@ struct ckhc_s {
};
struct ckh_s {
-#ifdef JEMALLOC_DEBUG
#define CKH_MAGIC 0x3af2489d
uint32_t magic;
-#endif
#ifdef CKH_COUNT
/* Counters used to get an idea of performance. */