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

Commit 3a10a9e7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "libbinder: no exit time destructors" into main

parents ecd8ac0c dc6e0720
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ cc_defaults {
        "-Wreorder-init-list",
        "-Wunused-const-variable",
        "-Wunused-result",
        "-Wexit-time-destructors",
        "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION",
        "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
        // Hide symbols by default and set the BUILDING_LIBBINDER macro so that
@@ -469,7 +470,6 @@ release_libbinder_binder_observer_config {
    },
}


soong_config_module_type {
    name: "libbinder_remove_cache_static_list_config",
    module_type: "cc_defaults",
+1 −1
Original line number Diff line number Diff line
@@ -364,7 +364,7 @@ status_t BBinder::stopRecordingTransactions() {

const String16& BBinder::getInterfaceDescriptor() const
{
    static StaticString16 sBBinder(u"BBinder");
    [[clang::no_destroy]] static StaticString16 sBBinder(u"BBinder");
    ALOGW("Reached BBinder::getInterfaceDescriptor (this=%p). Override?", this);
    return sBBinder;
}
+6 −6
Original line number Diff line number Diff line
@@ -40,16 +40,16 @@ using android::binder::unique_fd;

// ---------------------------------------------------------------------------

RpcMutex BpBinder::sTrackingLock;
std::unordered_map<int32_t, uint32_t> BpBinder::sTrackingMap;
std::unordered_map<int32_t, uint32_t> BpBinder::sLastLimitCallbackMap;
[[clang::no_destroy]] RpcMutex BpBinder::sTrackingLock;
[[clang::no_destroy]] std::unordered_map<int32_t, uint32_t> BpBinder::sTrackingMap;
[[clang::no_destroy]] std::unordered_map<int32_t, uint32_t> BpBinder::sLastLimitCallbackMap;
int BpBinder::sNumTrackedUids = 0;
std::atomic_bool BpBinder::sCountByUidEnabled(false);
binder_proxy_limit_callback BpBinder::sLimitCallback;
binder_proxy_warning_callback BpBinder::sWarningCallback;
[[clang::no_destroy]] binder_proxy_limit_callback BpBinder::sLimitCallback;
[[clang::no_destroy]] binder_proxy_warning_callback BpBinder::sWarningCallback;
bool BpBinder::sBinderProxyThrottleCreate = false;

static StaticString16 kDescriptorUninit(u"");
[[clang::no_destroy]] static StaticString16 kDescriptorUninit(u"");

// Arbitrarily high value that probably distinguishes a bad behaving app
uint32_t BpBinder::sBinderProxyCountHighWatermark = 2500;
+3 −0
Original line number Diff line number Diff line
@@ -258,7 +258,10 @@ void BufferedTextOutput::popBundle()
BufferedTextOutput::BufferState* BufferedTextOutput::getBuffer() const
{
    if ((mFlags&MULTITHREADED) != 0) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wexit-time-destructors"
        thread_local ThreadState ts;
#pragma clang diagnostic pop
        while (ts.states.size() <= (size_t)mIndex) ts.states.add(nullptr);
        BufferState* bs = ts.states[mIndex].get();
        if (bs != nullptr && bs->seq == mSeq) return bs;
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ private:
    // TODO: Reimplemement based on standard C++ container?
};

static sp<HeapCache> gHeapCache = sp<HeapCache>::make();
[[clang::no_destroy]] static sp<HeapCache> gHeapCache = sp<HeapCache>::make();

/******************************************************************************/

Loading