summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2011-12-01 09:44:23 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-12-01 09:44:23 -0800
commitd3af0ceb4b9b8632377c3000423a9a1b20aabc72 (patch)
tree1748f4a8c27c92db9f51c55fadce7eaf4b0e15e4
parent69c475676546a97f872df9e19125c0154b40ae0b (diff)
parentee155d4fe47fa751262beb43437a339fde8eabe5 (diff)
downloadandroid_dalvik-d3af0ceb4b9b8632377c3000423a9a1b20aabc72.tar.gz
android_dalvik-d3af0ceb4b9b8632377c3000423a9a1b20aabc72.tar.bz2
android_dalvik-d3af0ceb4b9b8632377c3000423a9a1b20aabc72.zip
am ee155d4f: Initialize the JNI indirect ref table to make Valgrind happy.
* commit 'ee155d4fe47fa751262beb43437a339fde8eabe5': Initialize the JNI indirect ref table to make Valgrind happy.
-rw-r--r--vm/IndirectRefTable.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm/IndirectRefTable.cpp b/vm/IndirectRefTable.cpp
index f0cbfec76..508ae3d51 100644
--- a/vm/IndirectRefTable.cpp
+++ b/vm/IndirectRefTable.cpp
@@ -38,9 +38,7 @@ bool IndirectRefTable::init(size_t initialCount,
if (table_ == NULL) {
return false;
}
-#ifndef NDEBUG
memset(table_, 0xd1, initialCount * sizeof(IndirectRefSlot));
-#endif
segmentState.all = IRT_FIRST_SEGMENT;
alloc_entries_ = initialCount;
@@ -116,6 +114,9 @@ IndirectRef IndirectRefTable::add(u4 cookie, Object* obj)
return NULL;
}
+ memset(newTable + alloc_entries_, 0xd1,
+ (newSize - alloc_entries_) * sizeof(IndirectRefSlot));
+
alloc_entries_ = newSize;
table_ = newTable;
}