summaryrefslogtreecommitdiffstats
path: root/runtime/gc/allocator/rosalloc.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-06-23 17:53:09 -0700
committerMathieu Chartier <mathieuc@google.com>2014-06-23 17:55:22 -0700
commita1c1c71e24c93a720bbf13de129c75a9a0bde37a (patch)
tree7c86b8684123587894997077680fdc7324954f9c /runtime/gc/allocator/rosalloc.h
parent9462a31caedefac3e04bd4aa5088e050ed188b30 (diff)
downloadandroid_art-a1c1c71e24c93a720bbf13de129c75a9a0bde37a.tar.gz
android_art-a1c1c71e24c93a720bbf13de129c75a9a0bde37a.tar.bz2
android_art-a1c1c71e24c93a720bbf13de129c75a9a0bde37a.zip
Use reader lock of bulk free lock when not freeing.
Should help reduce contention observed in systrace. Change-Id: Iadb81728d4ba797c3a68acea795b15d7f212e89b
Diffstat (limited to 'runtime/gc/allocator/rosalloc.h')
-rw-r--r--runtime/gc/allocator/rosalloc.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/runtime/gc/allocator/rosalloc.h b/runtime/gc/allocator/rosalloc.h
index a439188858..13f61ec935 100644
--- a/runtime/gc/allocator/rosalloc.h
+++ b/runtime/gc/allocator/rosalloc.h
@@ -45,10 +45,7 @@ class RosAlloc {
byte magic_num_; // The magic number used for debugging only.
bool IsFree() const {
- if (kIsDebugBuild) {
- return magic_num_ == kMagicNumFree;
- }
- return true;
+ return !kIsDebugBuild || magic_num_ == kMagicNumFree;
}
size_t ByteSize(RosAlloc* rosalloc) const EXCLUSIVE_LOCKS_REQUIRED(rosalloc->lock_) {
const byte* fpr_base = reinterpret_cast<const byte*>(this);