summaryrefslogtreecommitdiffstats
path: root/libs/binder
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-04-19 19:09:03 -0700
committerMathias Agopian <mathias@google.com>2010-04-19 19:09:03 -0700
commit92c3b393275e967f37162b40b3438c5616328372 (patch)
tree14f077c0233038875cc90dd8eb107decb117b667 /libs/binder
parente80c6f49d5055e299b7ada91b5967feab66e467b (diff)
downloadframeworks_base-92c3b393275e967f37162b40b3438c5616328372.zip
frameworks_base-92c3b393275e967f37162b40b3438c5616328372.tar.gz
frameworks_base-92c3b393275e967f37162b40b3438c5616328372.tar.bz2
fix [2599939] "cannot play video" after open/close a video player a dozen of times
get rid off the MAP_ONCE flag is MemoryHeapBase (as well as it's functionality), this feature should not be used anymore. the software renderer was incorrectly using the default ctor which set MAP_ONCE, causing the leak. the software renderer itself is incorrectly used while coming back from sleep. Change-Id: I123621f8d140550b864f352bbcd8a5729db12b57
Diffstat (limited to 'libs/binder')
-rw-r--r--libs/binder/IMemory.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/libs/binder/IMemory.cpp b/libs/binder/IMemory.cpp
index 6c1d225..bc8c412 100644
--- a/libs/binder/IMemory.cpp
+++ b/libs/binder/IMemory.cpp
@@ -46,7 +46,6 @@ public:
virtual void binderDied(const wp<IBinder>& who);
sp<IMemoryHeap> find_heap(const sp<IBinder>& binder);
- void pin_heap(const sp<IBinder>& binder);
void free_heap(const sp<IBinder>& binder);
sp<IMemoryHeap> get_heap(const sp<IBinder>& binder);
void dump_heaps();
@@ -100,13 +99,9 @@ private:
static inline void dump_heaps() {
gHeapCache->dump_heaps();
}
- void inline pin_heap() const {
- gHeapCache->pin_heap(const_cast<BpMemoryHeap*>(this)->asBinder());
- }
void assertMapped() const;
void assertReallyMapped() const;
- void pinHeap() const;
mutable volatile int32_t mHeapId;
mutable void* mBase;
@@ -320,11 +315,6 @@ void BpMemoryHeap::assertReallyMapped() const
asBinder().get(), size, fd, strerror(errno));
close(fd);
} else {
- if (flags & MAP_ONCE) {
- //LOGD("pinning heap (binder=%p, size=%d, fd=%d",
- // asBinder().get(), size, fd);
- pin_heap();
- }
mSize = size;
mFlags = flags;
android_atomic_write(fd, &mHeapId);
@@ -421,19 +411,6 @@ sp<IMemoryHeap> HeapCache::find_heap(const sp<IBinder>& binder)
}
}
-void HeapCache::pin_heap(const sp<IBinder>& binder)
-{
- Mutex::Autolock _l(mHeapCacheLock);
- ssize_t i = mHeapCache.indexOfKey(binder);
- if (i>=0) {
- heap_info_t& info(mHeapCache.editValueAt(i));
- android_atomic_inc(&info.count);
- binder->linkToDeath(this);
- } else {
- LOGE("pin_heap binder=%p not found!!!", binder.get());
- }
-}
-
void HeapCache::free_heap(const sp<IBinder>& binder) {
free_heap( wp<IBinder>(binder) );
}