Previously, in C++20 mode, using <=> on String8 or String16 would
compare the pointer values from the implicit conversion operators
returning const char* and const char16_t*. Instead, compare the string
content. This is especially a problem with STL containers that prefer
<=> when it is available.
See https://godbolt.org/z/cc1hW17h3 for a demo of the problem.
Bug: 339775405
Test: treehugger
Change-Id: I5ee6af96dee0c9968a1bab1ad96729e45bb1ac50
Avoid calling constructors/destructors for
each element, when we have Vector<T*>. These
are used in libbinder and elsewhere.
std::vector is still faster but uses more mem.
Bugs: me
Test: boot && binderLibTest
Change-Id: Id1239daddd018f8eee5480d1cb6dd25d6f4df808
A constexpr ctor is useful for static initialization.
We also modernize the unit test for static variable best practices.
Test: atest libutils_binder_test
Change-Id: If42c0939fb1a2dcb8eb101ed0e10051f67e2150d
Useful when dealing with raw pointers in unavoidable places. Avoids
an awkward (and "slow") dance of mySp->incStrong(0); mySp->get(); ~mySp;
Test: make && atest --host libutils_binder_test
Change-Id: Ib8d46150592725cc256779bccfed19a16dce78b2
This isolated all libutils_binder headers from libutils
except for RefBase use of CallStack.h. This header can
be disabled with a macro option easily.
Bug: N/A
Test: N/A
Change-Id: I83af091fc17b5418ab9e4d7fc41fb43792ec547d
Dependencies of libbinder, so we can build
a core libbinder library, libbinder_sdk.
This is preparing the way to move this part of libbinder
together with binder code into a single project.
Bug: 302720583
Change-Id: Icff078ac6e36c7f2b91cf815d5b9ed19b2e706e1