From 0880b3f17d8520b5295c36b6bfc5ce7dea917f3d Mon Sep 17 00:00:00 2001 From: Malinin Andrey Date: Thu, 1 Dec 2022 20:02:18 +0300 Subject: [PATCH] splitting alignment for internal objects Signed-off-by: Malinin Andrey --- runtime/object_factory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/object_factory.cpp b/runtime/object_factory.cpp index 283ed0394..3fbd66787 100644 --- a/runtime/object_factory.cpp +++ b/runtime/object_factory.cpp @@ -198,7 +198,7 @@ void ObjectFactory::NewJSArrayBufferData(const JSHandle &array, i JSTaggedValue data = array->GetArrayBufferData(); if (data != JSTaggedValue::Undefined()) { auto *pointer = JSNativePointer::Cast(data.GetTaggedObject()); - auto newData = Runtime::GetCurrent()->GetInternalAllocator()->Alloc(length * sizeof(uint8_t)); + auto newData = Runtime::GetCurrent()->GetInternalAllocator()->Alloc<>(length * sizeof(uint8_t)); if (memset_s(newData, length, 0, length) != EOK) { LOG_ECMA(FATAL) << "memset_s failed"; UNREACHABLE(); @@ -207,7 +207,7 @@ void ObjectFactory::NewJSArrayBufferData(const JSHandle &array, i return; } - auto newData = Runtime::GetCurrent()->GetInternalAllocator()->Alloc(length * sizeof(uint8_t)); + auto newData = Runtime::GetCurrent()->GetInternalAllocator()->Alloc<>(length * sizeof(uint8_t)); if (memset_s(newData, length, 0, length) != EOK) { LOG_ECMA(FATAL) << "memset_s failed"; UNREACHABLE(); @@ -226,7 +226,7 @@ JSHandle ObjectFactory::NewJSArrayBuffer(int32_t length) JSHandle arrayBuffer(NewJSObjectByConstructor(constructor, new_target)); arrayBuffer->SetArrayBufferByteLength(thread_, JSTaggedValue(length)); if (length > 0) { - auto newData = Runtime::GetCurrent()->GetInternalAllocator()->Alloc(length); + auto newData = Runtime::GetCurrent()->GetInternalAllocator()->Alloc<>(length); if (memset_s(newData, length, 0, length) != EOK) { LOG_ECMA(FATAL) << "memset_s failed"; UNREACHABLE(); @@ -287,7 +287,7 @@ void ObjectFactory::NewJSRegExpByteCodeData(const JSHandle ®exp, vo return; } - auto newBuffer = Runtime::GetCurrent()->GetInternalAllocator()->Alloc(size); + auto newBuffer = Runtime::GetCurrent()->GetInternalAllocator()->Alloc<>(size); if (memcpy_s(newBuffer, size, buffer, size) != EOK) { LOG_ECMA(FATAL) << "memcpy_s failed"; UNREACHABLE(); -- Gitee