MemoryDealer: expose internal allocation alignment
Bug: 27722308
Change-Id: Ie4ee1f54edcb711d39f8419a160af1495af0152e
diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp
index 8739625..51eac11 100644
--- a/libs/binder/MemoryDealer.cpp
+++ b/libs/binder/MemoryDealer.cpp
@@ -135,6 +135,8 @@
void dump(const char* what) const;
void dump(String8& res, const char* what) const;
+ static size_t getAllocationAlignment() { return kMemoryAlign; }
+
private:
struct chunk_t {
@@ -264,6 +266,12 @@
return mAllocator;
}
+// static
+size_t MemoryDealer::getAllocationAlignment()
+{
+ return SimpleBestFitAllocator::getAllocationAlignment();
+}
+
// ----------------------------------------------------------------------------
// align all the memory blocks on a cache-line boundary