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

Commit a39f3dbb authored by Devin Moore's avatar Devin Moore
Browse files

Create an empty String8 to cause the first allocation

There is an optimization that allocates a static empty String8 the first
time it's needed. This caused this test case to behave differently when
it was run alone vs when run with the rest of the binderAllocationLimits
test cases.

Test: atest
 binderAllocationLimits:binderAllocationLimits.BinderAllocation#SmallTransaction
Bug: 242614248
Change-Id: Idda3065796a23d0f0ec0a79dad34e2eeb554fe38
parent 372c4810
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@
#include <functional>
#include <vector>

static android::String8 gEmpty(""); // make sure first allocation from optimization runs

struct DestructionAction {
    DestructionAction(std::function<void()> f) : mF(std::move(f)) {}
    ~DestructionAction() { mF(); };