Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ce7ca55 authored by Steven Moreland's avatar Steven Moreland
Browse files

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
parent 1f1bed66
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -325,7 +325,7 @@ status_t BBinder::dump(int /*fd*/, const Vector<String16>& /*args*/)
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);