summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAliaksey Kandratsenka <alk@tut.by>2013-11-09 17:19:34 -0800
committerAliaksey Kandratsenka <alk@tut.by>2014-02-22 12:25:25 -0800
commit1d707cd4a3dfe6f238a530f945291acfd5995042 (patch)
treea4cba63d68c85663ffe637fd9c3efb73abdcc9cb
parent91bffcbad60d84beebe8b69a1db6c85c10fc04bf (diff)
downloadgperftools-1d707cd4a3dfe6f238a530f945291acfd5995042.tar.gz
issue-489: fixed warning
Computing certain values just for ASSERT raises just warning from compiler because if NDEBUG is set those are dead code.
-rw-r--r--src/page_heap.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/page_heap.cc b/src/page_heap.cc
index 651a93a..c6ecbb9 100644
--- a/src/page_heap.cc
+++ b/src/page_heap.cc
@@ -271,12 +271,14 @@ Span* PageHeap::Carve(Span* span, Length n) {
// The previous span of |leftover| was just splitted -- no need to
// coalesce them. The next span of |leftover| was not previously coalesced
// with |span|, i.e. is NULL or has got location other than |old_location|.
+#ifndef NDEBUG
const PageID p = leftover->start;
const Length len = leftover->length;
Span* next = GetDescriptor(p+len);
ASSERT (next == NULL ||
next->location == Span::IN_USE ||
next->location != leftover->location);
+#endif
PrependToFreeList(leftover); // Skip coalescing - no candidates possible
span->length = n;