Merge "IMemory: add unsecurePointer" am: b15d9c76df
am: a932b9f2f3
Change-Id: Ib6fa0d5fb646ea0b8a643996f583ed4e53de0d75
diff --git a/libs/binder/IMemory.cpp b/libs/binder/IMemory.cpp
index 094f89f..222b32c 100644
--- a/libs/binder/IMemory.cpp
+++ b/libs/binder/IMemory.cpp
@@ -149,6 +149,10 @@
return static_cast<char*>(base) + offset;
}
+void* IMemory::unsecurePointer() const {
+ return pointer();
+}
+
void* IMemory::pointer() const {
ssize_t offset;
sp<IMemoryHeap> heap = getMemory(&offset);
diff --git a/libs/binder/include/binder/IMemory.h b/libs/binder/include/binder/IMemory.h
index 3728029..98e92c4 100644
--- a/libs/binder/include/binder/IMemory.h
+++ b/libs/binder/include/binder/IMemory.h
@@ -76,6 +76,8 @@
// NOLINTNEXTLINE(google-default-arguments)
virtual sp<IMemoryHeap> getMemory(ssize_t* offset=nullptr, size_t* size=nullptr) const = 0;
+ void* unsecurePointer() const;
+
// helpers
void* fastPointer(const sp<IBinder>& heap, ssize_t offset) const;
void* pointer() const;