libbinder: BBinder::attachObject abort on OOM
This API doesn't really work in an OOM situation (even before the return
type was changed to a void*). Since we don't actually need or want to be
handling these situations gracefully in userspace Android, changing it
to an abort.
Bug: 192023359
Test: N/A
Change-Id: I8b7405bceb528e11a194c0d659d365975107b53f
diff --git a/libs/binder/Binder.cpp b/libs/binder/Binder.cpp
index 53750c9..628381c 100644
--- a/libs/binder/Binder.cpp
+++ b/libs/binder/Binder.cpp
@@ -325,7 +325,7 @@
void* BBinder::attachObject(const void* objectID, void* object, void* cleanupCookie,
object_cleanup_func func) {
Extras* e = getOrCreateExtras();
- if (!e) return nullptr; // out of memory
+ LOG_ALWAYS_FATAL_IF(!e, "no memory");
AutoMutex _l(e->mLock);
return e->mObjects.attach(objectID, object, cleanupCookie, func);