From 8cad650d14ae544620d98ea80190be2bb0795d40 Mon Sep 17 00:00:00 2001 From: zhangqing Date: Wed, 6 Nov 2024 10:15:02 +0800 Subject: [PATCH] arkui-x update master OH to weekly_20241028 and OH fix build bug Signed-off-by: zhangqing Change-Id: I0b70d4e95402e4a9baf55b20f4eb46e9cc008269 --- base/BUILD.gn | 6 +----- base/include/refbase.h | 17 ----------------- base/src/refbase.cpp | 38 -------------------------------------- 3 files changed, 1 insertion(+), 60 deletions(-) diff --git a/base/BUILD.gn b/base/BUILD.gn index 4778c44..4bec340 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn @@ -25,12 +25,8 @@ declare_args() { config("utils_config") { include_dirs = [ "include" ] - defines = [] if (current_os == "ios") { - defines += [ "IOS_PLATFORM" ] - } - if (is_emulator == true) { - defines += [ "EMULATOR_PLATFORM" ] + defines = [ "IOS_PLATFORM" ] } } diff --git a/base/include/refbase.h b/base/include/refbase.h index af3f6d6..7fcbef7 100644 --- a/base/include/refbase.h +++ b/base/include/refbase.h @@ -240,16 +240,6 @@ public: */ void ExtendObjectLifetime(); -#ifndef EMULATOR_PLATFORM - using CanPromote = std::function; - - void SetCanPromote(const CanPromote& canPromote); - - void RemoveCanPromote(); - - bool IsCanPromoteValid(); -#endif - #if ((defined DEBUG_REFBASE) && (!defined TRACK_ALL)) /** * @brief Enables tracking. It is applicable to debugging only. @@ -267,9 +257,6 @@ private: std::atomic atomicAttempt_; // Number of attempts RefPtrCallback callback_ = nullptr; // Callback function to deallocate the corresponding RefBase object static constexpr unsigned int FLAG_EXTEND_LIFE_TIME = 0x00000002; // Extended life-time bit to be set via logic-OR -#ifndef EMULATOR_PLATFORM - CanPromote canPromote_ = nullptr; -#endif #ifdef DEBUG_REFBASE #ifdef TRACK_ALL bool enableTrack = true; @@ -595,10 +582,6 @@ public: */ void EnableTracker(); -#ifndef EMULATOR_PLATFORM - virtual bool CanPromote(); -#endif - private: RefCounter *refs_ = nullptr; // Pointer to the corresponding reference // counter of this RefBase object diff --git a/base/src/refbase.cpp b/base/src/refbase.cpp index cb7426f..999c5f1 100644 --- a/base/src/refbase.cpp +++ b/base/src/refbase.cpp @@ -211,23 +211,6 @@ bool RefCounter::IsRefPtrValid() return callback_ != nullptr; } -#ifndef EMULATOR_PLATFORM -void RefCounter::SetCanPromote(const CanPromote &canPromote) -{ - canPromote_ = canPromote; -} - -void RefCounter::RemoveCanPromote() -{ - canPromote_ = nullptr; -} - -bool RefCounter::IsCanPromoteValid() -{ - return canPromote_ != nullptr; -} -#endif - RefCounter::~RefCounter() { #ifdef DEBUG_REFBASE @@ -374,11 +357,6 @@ bool RefCounter::AttemptIncStrongRef(const void *objectId, int &outCount) } if (IsLifeTimeExtended()) { -#ifndef EMULATOR_PLATFORM - if (!IsCanPromoteValid() || !canPromote_()) { - return false; - } -#endif curCount = atomicStrong_.fetch_add(1, std::memory_order_relaxed); } @@ -418,9 +396,6 @@ RefBase::RefBase() : refs_(new RefCounter()) { refs_->IncRefCount(); refs_->SetCallback([this] { this->RefPtrCallback(); }); -#ifndef EMULATOR_PLATFORM - refs_->SetCanPromote([this] { return this->CanPromote(); }); -#endif } RefBase::RefBase(const RefBase &) @@ -429,19 +404,9 @@ RefBase::RefBase(const RefBase &) if (refs_ != nullptr) { refs_->IncRefCount(); refs_->SetCallback([this] { this->RefPtrCallback(); }); -#ifndef EMULATOR_PLATFORM - refs_->SetCanPromote([this] { return this->CanPromote(); }); -#endif } } -#ifndef EMULATOR_PLATFORM -bool RefBase::CanPromote() -{ - return true; -} -#endif - void RefBase::RefPtrCallback() { delete this; @@ -464,9 +429,6 @@ RefBase &RefBase::operator=(const RefBase &) if (refs_ != nullptr) { refs_->IncRefCount(); refs_->SetCallback([this] { this->RefPtrCallback(); }); -#ifndef EMULATOR_PLATFORM - refs_->SetCanPromote([this] { return this->CanPromote(); }); -#endif } return *this; -- Gitee