summaryrefslogtreecommitdiff
path: root/libs/binder/MemoryDealer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/binder/MemoryDealer.cpp')
-rw-r--r--libs/binder/MemoryDealer.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp
index c4475c7780..ebf91f925e 100644
--- a/libs/binder/MemoryDealer.cpp
+++ b/libs/binder/MemoryDealer.cpp
@@ -228,8 +228,10 @@ Allocation::~Allocation()
// ----------------------------------------------------------------------------
MemoryDealer::MemoryDealer(size_t size, const char* name, uint32_t flags)
- : mHeap(sp<MemoryHeapBase>::make(size, flags, name)),
- mAllocator(new SimpleBestFitAllocator(size)) {}
+ : mHeap(new MemoryHeapBase(size, flags, name)),
+ mAllocator(new SimpleBestFitAllocator(size))
+{
+}
MemoryDealer::~MemoryDealer()
{
@@ -241,7 +243,7 @@ sp<IMemory> MemoryDealer::allocate(size_t size)
sp<IMemory> memory;
const ssize_t offset = allocator()->allocate(size);
if (offset >= 0) {
- memory = sp<Allocation>::make(sp<MemoryDealer>::fromExisting(this), heap(), offset, size);
+ memory = new Allocation(this, heap(), offset, size);
}
return memory;
}
@@ -385,7 +387,7 @@ SimpleBestFitAllocator::chunk_t* SimpleBestFitAllocator::dealloc(size_t start)
while (cur) {
if (cur->start == start) {
LOG_FATAL_IF(cur->free,
- "block at offset 0x%08lX of size 0x%08X already freed",
+ "block at offset 0x%08lX of size 0x%08lX already freed",
cur->start*kMemoryAlign, cur->size*kMemoryAlign);
// merge freed blocks together
@@ -409,7 +411,7 @@ SimpleBestFitAllocator::chunk_t* SimpleBestFitAllocator::dealloc(size_t start)
}
#endif
LOG_FATAL_IF(!freed->free,
- "freed block at offset 0x%08lX of size 0x%08X is not free!",
+ "freed block at offset 0x%08lX of size 0x%08lX is not free!",
freed->start * kMemoryAlign, freed->size * kMemoryAlign);
return freed;