diff options
author | Mathias Agopian <mathias@google.com> | 2009-05-22 19:00:22 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-05-26 16:12:20 -0700 |
commit | aaf834a284a025cedd8ec1cf01d09e1790c1dcf8 (patch) | |
tree | 6314488c2ccaa1ab96923a1c771593ee65e7a726 /libs/binder/MemoryDealer.cpp | |
parent | 7f36a5729f17fcb37a7b65a13fd86b0d922caca9 (diff) | |
download | frameworks_base-aaf834a284a025cedd8ec1cf01d09e1790c1dcf8.zip frameworks_base-aaf834a284a025cedd8ec1cf01d09e1790c1dcf8.tar.gz frameworks_base-aaf834a284a025cedd8ec1cf01d09e1790c1dcf8.tar.bz2 |
some work to try to reduce the code size of some native libraries
- make sure that all binder Bn classes define a ctor and dtor in their respective library.
This avoids duplication of the ctor/dtor in libraries where these objects are instantiated.
This is also cleaner, should we want these ctor/dtor to do something one day.
- same change as above for some Bp classes and various other non-binder classes
- moved the definition of CHECK_INTERFACE() in IInterface.h instead of having it everywhere.
- improved the CHECK_INTERFACE() macro so it calls a single method in Parcel, instead of inlining its code everywhere
- IBinder::getInterfaceDescriptor() now returns a "const String16&" instead of String16, which saves calls to String16 and ~String16
- implemented a cache for BpBinder::getInterfaceDescriptor(), since this does an IPC. HOWEVER, this method never seems to be called.
The cache makes BpBinder bigger, so we need to figure out if we need this method at all.
Diffstat (limited to 'libs/binder/MemoryDealer.cpp')
-rw-r--r-- | libs/binder/MemoryDealer.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp index fd6ab7a..d5ffe7f 100644 --- a/libs/binder/MemoryDealer.cpp +++ b/libs/binder/MemoryDealer.cpp @@ -38,7 +38,15 @@ #include <sys/file.h> namespace android { +// ---------------------------------------------------------------------------- +HeapInterface::HeapInterface() { } +HeapInterface::~HeapInterface() { } + +// ---------------------------------------------------------------------------- + +AllocatorInterface::AllocatorInterface() { } +AllocatorInterface::~AllocatorInterface() { } // ---------------------------------------------------------------------------- @@ -107,7 +115,7 @@ sp<IMemory> MemoryDealer::allocate(size_t size, uint32_t flags) if (new_memory != 0) { memory = new Allocation(this, offset, size, new_memory); } else { - LOGE("couldn't map [%8x, %d]", offset, size); + LOGE("couldn't map [%8lx, %u]", offset, size); if (size) { /* NOTE: it's VERY important to not free allocations of size 0 * because they're special as they don't have any record in the @@ -339,6 +347,10 @@ void SimpleBestFitAllocator::dump_l(String8& result, // ---------------------------------------------------------------------------- +SharedHeap::SharedHeap() + : HeapInterface(), MemoryHeapBase() +{ +} SharedHeap::SharedHeap(size_t size, uint32_t flags, char const * name) : MemoryHeapBase(size, flags, name) |