diff options
author | Jason Evans <je@fb.com> | 2012-04-18 20:38:40 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2012-04-18 20:38:40 (GMT) |
commit | 78f7352259768f670f8e1f9b000388dd32b62493 (patch) | |
tree | e6d541daec7f5076f9d3b4856cf31b8666f7c447 /src/arena.c | |
parent | 0b25fe79aaf8840a5acda7e3160a053d42349872 (diff) | |
download | jemalloc-78f7352259768f670f8e1f9b000388dd32b62493.zip jemalloc-78f7352259768f670f8e1f9b000388dd32b62493.tar.gz jemalloc-78f7352259768f670f8e1f9b000388dd32b62493.tar.bz2 |
Clean up a few config-related conditionals/asserts.
Clean up a few config-related conditionals to avoid unnecessary
dependencies on prof symbols. Use cassert() rather than assert()
everywhere that it's appropriate.
Diffstat (limited to 'src/arena.c')
-rw-r--r-- | src/arena.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/arena.c b/src/arena.c index 989034d..0f15562 100644 --- a/src/arena.c +++ b/src/arena.c @@ -1213,7 +1213,9 @@ void arena_prof_accum(arena_t *arena, uint64_t accumbytes) { - if (prof_interval != 0) { + cassert(config_prof); + + if (config_prof && prof_interval != 0) { arena->prof_accumbytes += accumbytes; if (arena->prof_accumbytes >= prof_interval) { prof_idump(); @@ -1490,8 +1492,8 @@ arena_salloc(const void *ptr, bool demote) } else { assert(((uintptr_t)ptr & PAGE_MASK) == 0); ret = mapbits & ~PAGE_MASK; - if (demote && prof_promote && ret == PAGE && (mapbits & - CHUNK_MAP_CLASS_MASK) != 0) { + if (config_prof && demote && prof_promote && ret == PAGE && + (mapbits & CHUNK_MAP_CLASS_MASK) != 0) { size_t binind = ((mapbits & CHUNK_MAP_CLASS_MASK) >> CHUNK_MAP_CLASS_SHIFT) - 1; assert(binind < NBINS); @@ -1509,7 +1511,7 @@ arena_prof_promoted(const void *ptr, size_t size) arena_chunk_t *chunk; size_t pageind, binind; - assert(config_prof); + cassert(config_prof); assert(ptr != NULL); assert(CHUNK_ADDR2BASE(ptr) != ptr); assert(isalloc(ptr, false) == PAGE); |