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

Commit 13b65390 authored by Steven Moreland's avatar Steven Moreland
Browse files

Merge "libbinder_ndk: private SharedRefBase construction" am: 1a4c7aee am:...

Merge "libbinder_ndk: private SharedRefBase construction" am: 1a4c7aee am: 0235b326 am: db5aceff

Change-Id: Ic7aff0f8071ec0080c1bd1efb7b7006212b9163b
parents 8b1d82f8 db5aceff
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -86,9 +86,15 @@ class SharedRefBase {
        return t->template ref<T>();
    }

    static void operator delete(void* p) { std::free(p); }

   private:
    std::once_flag mFlagThis;
    std::weak_ptr<SharedRefBase> mThis;

    // Use 'SharedRefBase::make<T>(...)' to make. SharedRefBase has implicit
    // ownership. Making this operator private to avoid double-ownership.
    static void* operator new(size_t s) { return std::malloc(s); }
};

/**