You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2016/01/12 03:17:05 UTC
incubator-kudu git commit: Fix mem_tracker-test failures on clang 3.7
-O3
Repository: incubator-kudu
Updated Branches:
refs/heads/master 556bf3b8d -> b14ea5165
Fix mem_tracker-test failures on clang 3.7 -O3
clang 3.7 running with -O3 has an optimization that removes unused
memory allocations. One of the mem_tracker-tests relies on making such
an allocation to artificially increase the heap usage, so the test would
fail.
This adds a useless log message to log the allocated pointer, defeating
the optimization.
Change-Id: Ic1015f93e65962ffa78062a83c20a643373810bc
Reviewed-on: http://gerrit.cloudera.org:8080/1750
Reviewed-by: Mike Percy <mp...@cloudera.com>
Tested-by: Todd Lipcon <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/b14ea516
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/b14ea516
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/b14ea516
Branch: refs/heads/master
Commit: b14ea5165c3772be8834cf70473788eaa7ee62d6
Parents: 556bf3b
Author: Todd Lipcon <to...@cloudera.com>
Authored: Thu Jan 7 19:05:21 2016 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Tue Jan 12 02:16:28 2016 +0000
----------------------------------------------------------------------
src/kudu/util/mem_tracker-test.cc | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/b14ea516/src/kudu/util/mem_tracker-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/mem_tracker-test.cc b/src/kudu/util/mem_tracker-test.cc
index 15b7364..86b8fad 100644
--- a/src/kudu/util/mem_tracker-test.cc
+++ b/src/kudu/util/mem_tracker-test.cc
@@ -297,6 +297,9 @@ TEST(MemTrackerTest, TcMallocRootTracker) {
// But if we allocate something really big, we should see a change.
gscoped_ptr<char[]> big_alloc(new char[4*1024*1024]);
+ // clang in release mode can optimize out the above allocation unless
+ // we do something with the pointer... so we just log it.
+ VLOG(8) << static_cast<void*>(big_alloc.get());
root->UpdateConsumption();
ASSERT_GT(root->consumption(), value);
}