From c46eb6bd11d5d732a8edf2cff1712b222aad99be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=BC=E5=8F=A4=E6=8B=89=E6=96=AF=E8=B5=B5=E5=85=AD?= Date: Fri, 22 Aug 2025 16:34:16 +0800 Subject: [PATCH] =?UTF-8?q?IsAlive=E5=87=BD=E6=95=B0=E9=80=82=E9=85=8Dcmcg?= =?UTF-8?q?c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 尼古拉斯赵六 --- ecmascript/mem/heap.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ecmascript/mem/heap.cpp b/ecmascript/mem/heap.cpp index 6ba62cfdd6..4aa241ae18 100644 --- a/ecmascript/mem/heap.cpp +++ b/ecmascript/mem/heap.cpp @@ -2756,9 +2756,16 @@ size_t Heap::GetHeapLimitSize() const bool BaseHeap::IsAlive(TaggedObject *object) const { - if (!ContainObject(object)) { - LOG_GC(ERROR) << "The region is already free"; - return false; + if (g_isEnableCMCGC) { + if (!common::Heap::IsHeapAddress(object)) { + LOG_GC(ERROR) << "The region is already free"; + return false; + } + } else { + if (!ContainObject(object)) { + LOG_GC(ERROR) << "The region is already free"; + return false; + } } bool isFree = object->GetClass() != nullptr && FreeObject::Cast(ToUintPtr(object))->IsFreeObject(); -- Gitee