From af4d763b7321dea878c4f2ada022e1f0a3bcfaf3 Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Fri, 20 Dec 2019 09:05:14 -0800 Subject: [PATCH] Fix unnecessary DmaBuffer copying in getIonMappedSizeKb Change the loop to access DmaBuffer by reference rather than copying it. Bug: 138148041 Signed-off-by: Suren Baghdasaryan Change-Id: I47fb49deb46d24897d75f350f4b47679cad37542 --- core/jni/android_os_Debug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp index 1ff28feb67386..3e7b6b3a6bffb 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -826,7 +826,7 @@ static jlong android_os_Debug_getIonMappedSizeKb(JNIEnv* env, jobject clazz) { } } - for (dmabufinfo::DmaBuffer buf : dmabufs) { + for (const dmabufinfo::DmaBuffer& buf : dmabufs) { ionPss += buf.size() / 1024; }