| /arkcompiler/ets_runtime/ecmascript/mem/ |
| D | heap-inl.h | 33 #define CHECK_OBJ_AND_THROW_OOM_ERROR(object, size, space, message) … argument 42 …(object) = reinterpret_cast<TaggedObject *>((space)->Allocate(size)); … 43 …ThrowOutOfMemoryError(size, message); … 132 size_t size = hclass->GetObjectSize(); in AllocateYoungOrHugeObject() local 133 return AllocateYoungOrHugeObject(hclass, size); in AllocateYoungOrHugeObject() 136 TaggedObject *Heap::AllocateYoungOrHugeObject(size_t size) in AllocateYoungOrHugeObject() argument 138 size = AlignUp(size, static_cast<size_t>(MemAlignment::MEM_ALIGN_OBJECT)); in AllocateYoungOrHugeObject() 139 if (size > MAX_REGULAR_HEAP_OBJECT_SIZE) { in AllocateYoungOrHugeObject() 140 return AllocateHugeObject(size); in AllocateYoungOrHugeObject() 143 auto object = reinterpret_cast<TaggedObject *>(activeSemiSpace_->Allocate(size)); in AllocateYoungOrHugeObject() [all …]
|
| D | tlab_allocator-inl.h | 47 uintptr_t TlabAllocator::Allocate(size_t size, MemSpaceType space) in Allocate() argument 52 result = AllocateInYoungSpace(size); in Allocate() 55 result = AllocateInOldSpace(size); in Allocate() 58 result = AllocateInCompressSpace(size); in Allocate() 67 uintptr_t TlabAllocator::AllocateInYoungSpace(size_t size) in AllocateInYoungSpace() argument 69 ASSERT(AlignUp(size, static_cast<size_t>(MemAlignment::MEM_ALIGN_OBJECT)) == size); in AllocateInYoungSpace() 70 if (UNLIKELY(size > SMALL_OBJECT_SIZE)) { in AllocateInYoungSpace() 71 uintptr_t address = heap_->AllocateYoungSync(size); in AllocateInYoungSpace() 74 uintptr_t result = youngAllocator_.Allocate(size); in AllocateInYoungSpace() 82 return youngAllocator_.Allocate(size); in AllocateInYoungSpace() [all …]
|
| D | allocator-inl.h | 56 uintptr_t BumpPointerAllocator::Allocate(size_t size) in Allocate() argument 58 ASSERT(size != 0); in Allocate() 60 if (UNLIKELY(top_ + size > end_)) { in Allocate() 65 ASAN_UNPOISON_MEMORY_REGION(reinterpret_cast<void *>(result), size); in Allocate() 66 top_ += size; in Allocate() 95 uintptr_t FreeListAllocator::Allocate(size_t size) in Allocate() argument 97 auto ret = bpAllocator_.Allocate(size); in Allocate() 99 allocationSizeAccumulator_ += size; in Allocate() 102 FreeObject *object = freeList_->Allocate(size); in Allocate() 104 ret = Allocate(object, size); in Allocate() [all …]
|
| D | native_area_allocator.cpp | 26 LOG_ECMA_MEM(FATAL) << "capacity must have a size not less than sizeof Area."; in AllocateArea() 37 LOG_ECMA_MEM(FATAL) << "malloc failed, current alloc size = " << capacity in AllocateArea() 38 … << ", total allocated size = " << nativeMemoryUsage_.load(std::memory_order_relaxed); in AllocateArea() 63 auto size = area->GetSize() + sizeof(Area); in FreeArea() local 64 DecreaseNativeMemoryUsage(size); in FreeArea() 66 if (memset_s(area, size, INVALID_VALUE, size) != EOK) { in FreeArea() 75 void NativeAreaAllocator::Free(void *mem, size_t size) in Free() argument 80 DecreaseNativeMemoryUsage(size); in Free() 82 if (memset_s(mem, size, INVALID_VALUE, size) != EOK) { in Free() 91 void *NativeAreaAllocator::AllocateBuffer(size_t size) in AllocateBuffer() argument [all …]
|
| D | sparse_space.h | 23 #define CHECK_OBJECT_AND_INC_OBJ_SIZE(size) \ argument 25 IncreaseLiveObjectSize(size); \ 27 Region::ObjectAddressToRange(object)->IncreaseAliveObject(size); \ 29 InvokeAllocationInspector(object, size, size); \ 33 #define CHECK_OBJECT_AND_INC_OBJ_SIZE(size) \ argument 35 IncreaseLiveObjectSize(size); \ 37 Region::ObjectAddressToRange(object)->IncreaseAliveObject(size); \ 66 uintptr_t Allocate(size_t size, bool allowGC = true); 84 Region *TryToGetSuitableSweptRegion(size_t size); 97 void IncreaseAllocatedSize(size_t size); [all …]
|
| /arkcompiler/runtime_core/static_core/libpandabase/os/ |
| D | mem.h | 43 PANDA_PUBLIC_API void MmapDeleter(std::byte *ptr, size_t size) noexcept; 46 * @brief Make memory region @param mem with size @param size with protection flags @param prot 47 * @param mem Pointer to memory region (should be aligned to page size) 48 * @param size Size of memory region 52 std::optional<Error> MakeMemWithProtFlag(void *mem, size_t size, int prot); 55 * @brief Make memory region @param mem with size @param size readable and executable 56 * @param mem Pointer to memory region (should be aligned to page size) 57 * @param size Size of memory region 60 std::optional<Error> MakeMemReadExec(void *mem, size_t size); 63 * @brief Make memory region @param mem with size @param size readable and writable [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/jsvaluereffoundationvalue_fuzzer/ |
| D | jsvaluereffoundationvalue_fuzzer.cpp | 27 void JSValueRefIsNumberValueFuzzTest(const uint8_t *data, size_t size) in JSValueRefIsNumberValueFuzzTest() argument 34 if (data == nullptr || size <= 0) { in JSValueRefIsNumberValueFuzzTest() 38 if (size > MAXBYTELEN) { in JSValueRefIsNumberValueFuzzTest() 39 size = MAXBYTELEN; in JSValueRefIsNumberValueFuzzTest() 41 if (memcpy_s(&key, MAXBYTELEN, data, size) != EOK) { in JSValueRefIsNumberValueFuzzTest() 46 if (memcpy_s(&inputUnit32, MAXBYTELEN, data, size) != EOK) { in JSValueRefIsNumberValueFuzzTest() 52 if (size == 0 || data == nullptr) { in JSValueRefIsNumberValueFuzzTest() 56 Local<StringRef> stringUtf8 = StringRef::NewFromUtf8(vm, (char *)data, (int)size); in JSValueRefIsNumberValueFuzzTest() 64 void JSValueRefIsStringValueFuzzTest(const uint8_t *data, size_t size) in JSValueRefIsStringValueFuzzTest() argument 69 if (data == nullptr || size <= 0) { in JSValueRefIsStringValueFuzzTest() [all …]
|
| /arkcompiler/runtime_core/libpandabase/os/ |
| D | mem.h | 41 void MmapDeleter(std::byte *ptr, size_t size) noexcept; 44 * \brief Make memory region \param mem with size \param size with protection flags \param prot 45 * @param mem Pointer to memory region (should be aligned to page size) 46 * @param size Size of memory region 50 std::optional<Error> MakeMemWithProtFlag(void *mem, size_t size, int prot); 53 * \brief Make memory region \param mem with size \param size readable and executable 54 * @param mem Pointer to memory region (should be aligned to page size) 55 * @param size Size of memory region 58 std::optional<Error> MakeMemReadExec(void *mem, size_t size); 61 * \brief Make memory region \param mem with size \param size readable and writable [all …]
|
| /arkcompiler/ets_runtime/ecmascript/tests/ |
| D | dump_test.cpp | 184 JSHandle<JSHClass> mapClass = factory->NewEcmaHClass(JSMap::SIZE, JSType::JS_MAP, proto); in NewJSMap() 193 JSHandle<JSHClass> setClass = factory->NewEcmaHClass(JSSet::SIZE, JSType::JS_SET, proto); in NewJSSet() 204 …JSHandle<JSHClass> mapClass = factory->NewEcmaHClass(JSAPIHashMap::SIZE, JSType::JS_API_HASH_MAP, … in NewJSAPIHashMap() 215 …JSHandle<JSHClass> setClass = factory->NewEcmaHClass(JSAPIHashSet::SIZE, JSType::JS_API_HASH_SET, … in NewJSAPIHashSet() 226 …JSHandle<JSHClass> mapClass = factory->NewEcmaHClass(JSAPITreeMap::SIZE, JSType::JS_API_TREE_MAP, … in NewJSAPITreeMap() 237 …JSHandle<JSHClass> setClass = factory->NewEcmaHClass(JSAPITreeSet::SIZE, JSType::JS_API_TREE_SET, … in NewJSAPITreeSet() 248 …JSHandle<JSHClass> mapClass = factory->NewEcmaHClass(JSAPIPlainArray::SIZE, JSType::JS_API_PLAIN_A… in NewJSAPIPlainArray() 264 …JSHandle<JSHClass> listClass = factory->NewEcmaHClass(JSAPIList::SIZE, JSType::JS_API_LIST, proto); in NewJSAPIList() 275 …JSHandle<JSHClass> mapClass = factory->NewEcmaHClass(JSAPILinkedList::SIZE, JSType::JS_API_LINKED_… in NewJSAPILinkedList() 294 factory->NewEcmaHClass(JSAPIArrayList::SIZE, JSType::JS_API_ARRAY_LIST, proto); in NewJSAPIArrayList() [all …]
|
| /arkcompiler/runtime_core/static_core/verification/util/tests/ |
| D | bit_vector_property_test.cpp | 43 if (bits.SetBitsCount() != indices.size()) { in IsEqual() 68 for (size_t idx = 0; idx < bitset.bits.Size(); ++idx) { in ShowValue() 96 size_t size = (set.empty() ? 0 : *set.rbegin()) + inc; in arbitrary() local 97 BitVector bits {size}; in arbitrary() 126 void ClassifySize(const std::string &name, size_t size, const Intervals &intervals) in ClassifySize() argument 129 RC_CLASSIFY(i.Contains(size), name + " " + std::to_string(i)); in ClassifySize() 141 ClassifySize("Bits.size() in", bitset.bits.Size(), g_statIntervals); in Stat() 142 ClassifySize("Indices.size() in", bitset.indices.size(), g_statIntervals); in Stat() 146 StdSet Universum(size_t size) in Universum() argument 148 return ToSet<StdSet>(Interval(0, size - 1)); in Universum() [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/containerslinkedlistcommon_fuzzer/ |
| D | containerslinkedlistcommon_fuzzer.h | 107 static void ContainersLinkedListAddFuzzTest(const uint8_t* data, size_t size) in ContainersLinkedListAddFuzzTest() argument 115 if (size <= 0) { in ContainersLinkedListAddFuzzTest() 118 if (size > MAXBYTELEN) { in ContainersLinkedListAddFuzzTest() 119 size = MAXBYTELEN; in ContainersLinkedListAddFuzzTest() 121 if (memcpy_s(&value, MAXBYTELEN, data, size) != 0) { in ContainersLinkedListAddFuzzTest() 129 static void ContainersLinkedListGetFirstFuzzTest(const uint8_t* data, size_t size) in ContainersLinkedListGetFirstFuzzTest() argument 137 if (size <= 0) { in ContainersLinkedListGetFirstFuzzTest() 140 if (size > MAXBYTELEN) { in ContainersLinkedListGetFirstFuzzTest() 141 size = MAXBYTELEN; in ContainersLinkedListGetFirstFuzzTest() 143 if (memcpy_s(&value, MAXBYTELEN, data, size) != 0) { in ContainersLinkedListGetFirstFuzzTest() [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/objectgetinformation_fuzzer/ |
| D | objectgetinformation_fuzzer.cpp | 24 void ObjectGetAllPropertyNamesFuzzTest(const uint8_t *data, size_t size) in ObjectGetAllPropertyNamesFuzzTest() argument 29 if (data == nullptr || size <= 0) { in ObjectGetAllPropertyNamesFuzzTest() 35 if (size > maxByteLen1) { in ObjectGetAllPropertyNamesFuzzTest() 36 size = maxByteLen1; in ObjectGetAllPropertyNamesFuzzTest() 38 if (memcpy_s(&index, maxByteLen1, data, size) != EOK) { in ObjectGetAllPropertyNamesFuzzTest() 44 if (size > maxByteLen2) { in ObjectGetAllPropertyNamesFuzzTest() 45 size = maxByteLen2; in ObjectGetAllPropertyNamesFuzzTest() 47 if (memcpy_s(&filter, maxByteLen2, data, size) != EOK) { in ObjectGetAllPropertyNamesFuzzTest() 58 void ObjectGetNativePointerFieldCountFuzzTest(const uint8_t *data, size_t size) in ObjectGetNativePointerFieldCountFuzzTest() argument 63 if (data == nullptr || size <= 0) { in ObjectGetNativePointerFieldCountFuzzTest() [all …]
|
| /arkcompiler/runtime_core/static_core/platforms/unix/libpandabase/ |
| D | mem.cpp | 34 void MmapDeleter(std::byte *ptr, size_t size) noexcept in MmapDeleter() argument 37 munmap(ptr, size); in MmapDeleter() 41 BytePtr MapFile(file::File file, uint32_t prot, uint32_t flags, size_t size, size_t fileOffset, voi… in MapFile() argument 45 size_t mapSize = size + offset; in MapFile() 54 return BytePtr(static_cast<std::byte *>(result) + offset, size, offset, MmapDeleter); in MapFile() 57 BytePtr MapExecuted(size_t size) in MapExecuted() argument 59 // By design caller should pass valid size, so don't do any additional checks except ones that in MapExecuted() 62 void *result = mmap(nullptr, size, PROT_EXEC | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); in MapExecuted() 67 return BytePtr(static_cast<std::byte *>(result), (result == nullptr) ? 0 : size, MmapDeleter); in MapExecuted() 70 std::optional<Error> MakeMemWithProtFlag(void *mem, size_t size, int prot) in MakeMemWithProtFlag() argument [all …]
|
| /arkcompiler/runtime_core/platforms/unix/libpandabase/ |
| D | mem.cpp | 33 void MmapDeleter(std::byte *ptr, size_t size) noexcept in MmapDeleter() argument 36 munmap(ptr, size); in MmapDeleter() 40 BytePtr MapFile(file::File file, uint32_t prot, uint32_t flags, size_t size, size_t file_offset, vo… in MapFile() argument 44 size_t map_size = size + offset; in MapFile() 52 return BytePtr(static_cast<std::byte *>(result) + offset, size, offset, MmapDeleter); in MapFile() 55 BytePtr MapExecuted(size_t size) in MapExecuted() argument 57 // By design caller should pass valid size, so don't do any additional checks except ones that in MapExecuted() 60 void *result = mmap(nullptr, size, PROT_EXEC | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); in MapExecuted() 65 return BytePtr(static_cast<std::byte *>(result), (result == nullptr) ? 0 : size, MmapDeleter); in MapExecuted() 68 std::optional<Error> MakeMemWithProtFlag(void *mem, size_t size, int prot) in MakeMemWithProtFlag() argument [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/17.experimental_features/02.array_creation_expressions/ |
| D | expr.params.yaml | 17 let size = 1 // identity dimension conversion 18 let v: number[] = new number[size] 24 let size: Int = new Int(1) // unboxing dimension conversion 25 let v: number[] = new number[size] 31 let size: long = 1 as long // narrowing dimension conversion 32 let v: Byte[] = new Byte[size] 38 let size: Long = new Long(1 as long) // unboxing and narrowing dimension conversion 39 let v: Byte[] = new Byte[size] 45 let size: number = 1 // narrowing dimension conversion 46 let v: Byte[] = new Byte[size] [all …]
|
| /arkcompiler/runtime_core/libpandabase/mem/ |
| D | mmap_mem_pool-inl.h | 32 inline Pool MmapPoolMap::PopFreePool(size_t size) in PopFreePool() argument 34 auto element = free_pools_.lower_bound(size); in PopFreePool() 45 Pool pool(size, element_mem); in PopFreePool() 47 if (size < element_size) { in PopFreePool() 48 Pool new_pool(element_size - size, ToVoidPtr(ToUintPtr(element_mem) + size)); in PopFreePool() 49 mmap_pool->SetSize(size); in PopFreePool() 134 // We should get aligned to PANDA_POOL_ALIGNMENT_IN_BYTES size in MmapMemPool() 147 … << ToVoidPtr(min_object_memory_addr_) << " Preallocated size is equal to " in MmapMemPool() 180 inline ArenaT *MmapMemPool::AllocArenaImpl(size_t size, SpaceType space_type, AllocatorType allocat… in AllocArenaImpl() argument 184 LOG_MMAP_MEM_POOL(DEBUG) << "Try to get new arena with size " << std::dec << size << " for " in AllocArenaImpl() [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/jsvaluerefiscorrect_fuzzer/ |
| D | jsvaluerefiscorrect_fuzzer.cpp | 26 void JSValueRefIsFalseFuzzTest([[maybe_unused]]const uint8_t *data, size_t size) in JSValueRefIsFalseFuzzTest() argument 31 if (size <= 0) { in JSValueRefIsFalseFuzzTest() 40 void JSValueRefIsTrueFuzzTest(const uint8_t *data, size_t size) in JSValueRefIsTrueFuzzTest() argument 45 if (data == nullptr || size <= 0) { in JSValueRefIsTrueFuzzTest() 50 size = size > sizeof(int) ? sizeof(int) : size; in JSValueRefIsTrueFuzzTest() 51 if (memcpy_s(&value, sizeof(int), data, size) != EOK) { in JSValueRefIsTrueFuzzTest() 61 void JSValueRefIsHoleFuzzTest(const uint8_t *data, size_t size) in JSValueRefIsHoleFuzzTest() argument 66 if (data == nullptr || size <= 0) { in JSValueRefIsHoleFuzzTest() 71 size = size > sizeof(int) ? sizeof(int) : size; in JSValueRefIsHoleFuzzTest() 72 if (memcpy_s(&value, sizeof(int), data, size) != EOK) { in JSValueRefIsHoleFuzzTest() [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/jsvaluerefisarray_fuzzer/ |
| D | jsvaluerefisarray_fuzzer.cpp | 24 void IsInt8ArrayFuzztest(const uint8_t *data, size_t size) in IsInt8ArrayFuzztest() argument 29 if (data == nullptr || size <= 0) { in IsInt8ArrayFuzztest() 34 …Local<ArrayBufferRef> arrayBuffer = ArrayBufferRef::New(vm, (void *)data, (int32_t)size, deleter, … in IsInt8ArrayFuzztest() 35 Local<JSValueRef> typedArray = Int8ArrayRef::New(vm, arrayBuffer, 0, (int32_t)size); in IsInt8ArrayFuzztest() 40 void IsUint8ArrayFuzztest(const uint8_t *data, size_t size) in IsUint8ArrayFuzztest() argument 45 if (data == nullptr || size <= 0) { in IsUint8ArrayFuzztest() 50 …Local<ArrayBufferRef> arrayBuffer = ArrayBufferRef::New(vm, (void *)data, (int32_t)size, deleter, … in IsUint8ArrayFuzztest() 51 Local<JSValueRef> typedArray = Uint8ArrayRef::New(vm, arrayBuffer, 0, (int32_t)size); in IsUint8ArrayFuzztest() 56 void IsUint8ClampedArrayFuzztest(const uint8_t *data, size_t size) in IsUint8ClampedArrayFuzztest() argument 61 if (data == nullptr || size <= 0) { in IsUint8ClampedArrayFuzztest() [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/templateclassglobal_fuzzer/ |
| D | templateclassglobal_fuzzer.cpp | 25 void TemplateGlobalFuzzerTest([[maybe_unused]]const uint8_t* data, size_t size) in TemplateGlobalFuzzerTest() argument 30 if (size <= 0) { in TemplateGlobalFuzzerTest() 39 void TemplateToLocalFuzzerTest([[maybe_unused]]const uint8_t* data, size_t size) in TemplateToLocalFuzzerTest() argument 44 if (size <= 0) { in TemplateToLocalFuzzerTest() 53 void TemplateToLocalFromVMFuzzerTest([[maybe_unused]]const uint8_t* data, size_t size) in TemplateToLocalFromVMFuzzerTest() argument 58 if (size <= 0) { in TemplateToLocalFromVMFuzzerTest() 67 void TemplateEmptyFuzzerTest([[maybe_unused]]const uint8_t* data, size_t size) in TemplateEmptyFuzzerTest() argument 72 if (size <= 0) { in TemplateEmptyFuzzerTest() 81 void TemplateFreeGlobalHandleAddrFuzzerTest([[maybe_unused]]const uint8_t* data, size_t size) in TemplateFreeGlobalHandleAddrFuzzerTest() argument 86 if (size <= 0) { in TemplateFreeGlobalHandleAddrFuzzerTest() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/ |
| D | global_env_constants.cpp | 103 … factory->NewEcmaReadOnlyHClass(hClass, FreeObject::SIZE, JSType::FREE_OBJECT_WITH_TWO_FIELD)); in InitRootsClass() 130 factory->NewEcmaReadOnlyHClass(hClass, BigInt::SIZE, JSType::BIGINT)); in InitRootsClass() 132 … factory->NewEcmaReadOnlyHClass(hClass, JSNativePointer::SIZE, JSType::JS_NATIVE_POINTER)); in InitRootsClass() 136 factory->NewEcmaReadOnlyHClass(hClass, JSSymbol::SIZE, JSType::SYMBOL)); in InitRootsClass() 138 factory->NewEcmaReadOnlyHClass(hClass, AccessorData::SIZE, JSType::ACCESSOR_DATA)); in InitRootsClass() 140 … factory->NewEcmaReadOnlyHClass(hClass, AccessorData::SIZE, JSType::INTERNAL_ACCESSOR)); in InitRootsClass() 142 factory->NewEcmaHClass(hClass, JSProxy::SIZE, JSType::JS_PROXY)); in InitRootsClass() 144 … factory->NewEcmaReadOnlyHClass(hClass, CompletionRecord::SIZE, JSType::COMPLETION_RECORD)); in InitRootsClass() 146 … factory->NewEcmaReadOnlyHClass(hClass, GeneratorContext::SIZE, JSType::JS_GENERATOR_CONTEXT)); in InitRootsClass() 148 factory->NewEcmaReadOnlyHClass(hClass, AsyncGeneratorRequest::SIZE, in InitRootsClass() [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/jsvaluerefobject_fuzzer/ |
| D | jsvaluerefobject_fuzzer.cpp | 26 void JSValueRefIsSymbolFuzzTest(const uint8_t* data, size_t size) in JSValueRefIsSymbolFuzzTest() argument 31 if (data == nullptr || size <= 0) { in JSValueRefIsSymbolFuzzTest() 35 Local<StringRef> description = StringRef::NewFromUtf8(vm, (char*)data, size); in JSValueRefIsSymbolFuzzTest() 41 void JSValueRefIsBigIntFuzzTest([[maybe_unused]]const uint8_t* data, size_t size) in JSValueRefIsBigIntFuzzTest() argument 46 if (size <= 0) { in JSValueRefIsBigIntFuzzTest() 56 void JSValueRefIsObjectFuzzTest([[maybe_unused]]const uint8_t* data, size_t size) in JSValueRefIsObjectFuzzTest() argument 61 if (size <= 0) { in JSValueRefIsObjectFuzzTest() 65 Local<JSValueRef> res = IntegerRef::New(vm, (int)size); in JSValueRefIsObjectFuzzTest() 70 void IsArgumentsObjectFuzzTest([[maybe_unused]]const uint8_t* data, size_t size) in IsArgumentsObjectFuzzTest() argument 75 if (size <= 0) { in IsArgumentsObjectFuzzTest() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/mempool/src/ |
| D | mempool.cpp | 95 MemBlock *MemPoolCtrler::AllocMemBlock(const MemPool &pool, size_t size) in AllocMemBlock() argument 97 if (size <= kMemBlockSizeMin) { in AllocMemBlock() 100 return AllocBigMemBlock(pool, size); in AllocMemBlock() 128 MemBlock *MemPoolCtrler::AllocBigMemBlock(const MemPool &pool, size_t size) const in AllocBigMemBlock() 130 … DEBUG_ASSERT(size > kMemBlockSizeMin, "Big memory block must be bigger than fixed memory block"); in AllocBigMemBlock() 133 uint8_t *block = reinterpret_cast<uint8_t *>(malloc(size)); in AllocBigMemBlock() 135 return new MemBlock(block, size); in AllocBigMemBlock() 143 void *MemPool::Malloc(size_t size) in Malloc() argument 145 size = BITS_ALIGN(size); in Malloc() 147 if (size > static_cast<size_t>(endPtr - curPtr)) { in Malloc() [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/arraylist_fuzzer/ |
| D | arraylist_fuzzer.cpp | 123 void ArrayListForEachFuzzTest(const uint8_t* data, size_t size) in ArrayListForEachFuzzTest() argument 125 if (data == nullptr || size <= 0) { in ArrayListForEachFuzzTest() 137 if (size > MAXBYTELEN) { in ArrayListForEachFuzzTest() 138 size = MAXBYTELEN; in ArrayListForEachFuzzTest() 140 if (memcpy_s(&inputNum, MAXBYTELEN, data, size) != 0) { in ArrayListForEachFuzzTest() 162 void ArrayListAddFuzzTest(const uint8_t* data, size_t size) in ArrayListAddFuzzTest() argument 175 if (size <= 0) { in ArrayListAddFuzzTest() 178 if (size > MAXBYTELEN) { in ArrayListAddFuzzTest() 179 size = MAXBYTELEN; in ArrayListAddFuzzTest() 181 if (memcpy_s(&inputNum, MAXBYTELEN, data, size) != 0) { in ArrayListAddFuzzTest() [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/bufferrefnew_fuzzer/ |
| D | bufferrefnew_fuzzer.cpp | 24 void BufferRefNewFuzzTest([[maybe_unused]]const uint8_t *data, size_t size) in BufferRefNewFuzzTest() argument 29 if (size <= 0) { in BufferRefNewFuzzTest() 33 BufferRef::New(vm, (int32_t)size); in BufferRefNewFuzzTest() 37 void BufferRefMultiParamNewFuzzTest(const uint8_t *data, size_t size) in BufferRefMultiParamNewFuzzTest() argument 39 if (data == nullptr || size <= 0) { in BufferRefMultiParamNewFuzzTest() 47 BufferRef::New(vm, (void *)data, (int32_t)size, deleter, (void *)data); in BufferRefMultiParamNewFuzzTest() 51 void BufferRefByteLengthFuzzTest([[maybe_unused]]const uint8_t *data, size_t size) in BufferRefByteLengthFuzzTest() argument 56 if (size <= 0) { in BufferRefByteLengthFuzzTest() 60 Local<BufferRef> buffer = BufferRef::New(vm, (int32_t)size); in BufferRefByteLengthFuzzTest() 65 void BufferRefGetBufferFuzzTest([[maybe_unused]]const uint8_t *data, size_t size) in BufferRefGetBufferFuzzTest() argument [all …]
|
| /arkcompiler/runtime_core/static_core/libpandabase/serializer/ |
| D | serializer.h | 61 // pack size 62 uint32_t size = vec.size() * sizeof(Type); 63 auto ret = TypeToBuffer(size, buffer); 70 const uint8_t *ptrEnd = ToUint8tPtr(ToUintPtr(ptr) + size); 72 return ret.Value() + size; 79 // pack size 80 auto ret = TypeToBuffer(static_cast<uint32_t>(map.size()), buffer); 105 Expected<size_t, const char *> BufferToType(const uint8_t *data, size_t size, T &out) in BufferToType() argument 109 if (sizeof(out) > size) { in BufferToType() 119 inline Expected<size_t, const char *> BufferToTypeUnpackString(const uint8_t *data, size_t size, st… in BufferToTypeUnpackString() argument [all …]
|