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

Commit 1a4c7aee authored by Steven Moreland's avatar Steven Moreland Committed by Gerrit Code Review
Browse files

Merge "libbinder_ndk: private SharedRefBase construction"

parents 51c6a7c8 10d9ddf2
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); }
};

/**