diff --git a/runtime/object_factory.cpp b/runtime/object_factory.cpp index 283ed039433199f0c83e913609b30af9f2cb2c89..3fbd66787819de2458ba2d8554817ec2fc47daa7 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();