summaryrefslogtreecommitdiff
path: root/libhidlmemory
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2017-10-02 13:28:24 -0700
committerSteven Moreland <smoreland@google.com>2017-10-02 13:28:24 -0700
commit534d2afd7d729953bdf28e8e214b8abb9245f66c (patch)
tree1310e226bbed3a0c3eb59b6bd3db395c8776e527 /libhidlmemory
parent96e9de049f4dd2ee7d02eaf9a662e286964c2039 (diff)
downloadlibhidl-534d2afd7d729953bdf28e8e214b8abb9245f66c.tar.gz
libhidlmemory: clarify mapMemory function.
This function has been abused in the past. The result from mapMemory should be cached and used rather than the hidl_memory object itself. Bug: 34234561 Test: none Change-Id: I0e1705553243979d6174c3c971b3373d99350191
Diffstat (limited to 'libhidlmemory')
-rw-r--r--libhidlmemory/include/hidlmemory/mapping.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libhidlmemory/include/hidlmemory/mapping.h b/libhidlmemory/include/hidlmemory/mapping.h
index 5e1dab3..e15eb80 100644
--- a/libhidlmemory/include/hidlmemory/mapping.h
+++ b/libhidlmemory/include/hidlmemory/mapping.h
@@ -22,6 +22,9 @@ namespace hardware {
/**
* Returns the IMemory instance corresponding to a hidl_memory object.
* If the shared memory cannot be fetched, this returns nullptr.
+ *
+ * Note, this method call is relatively expensive and does not cache conversions.
+ * It should only be done when initializing a buffer and not on every buffer read.
*/
sp<android::hidl::memory::V1_0::IMemory> mapMemory(const hidl_memory &memory);