Home
last modified time | relevance | path

Searched refs:newSize (Results 1 – 8 of 8) sorted by relevance

/drivers/hdf_core/framework/tools/hdi-gen/util/
Dstring_builder.cpp122 size_t newSize = (capacity_ == 0) ? 256 : (capacity_ * 2); in Grow() local
123 if (newSize < capacity_ + size) { in Grow()
124 newSize = capacity_ + size; in Grow()
126 if (newSize > StringHelper::maxSize) { in Grow()
127 newSize = StringHelper::maxSize; in Grow()
129 if (newSize <= capacity_) { in Grow()
133 char *newBuffer = reinterpret_cast<char *>(calloc(newSize, 1)); in Grow()
135 Logger::E(TAG, "Fail to malloc %lu bytes memory.", newSize); in Grow()
140 (void)memcpy_s(newBuffer, newSize, buffer_, capacity_); in Grow()
144 capacity_ = newSize; in Grow()
/drivers/interface/display/composer/command_pack/
Dcommand_data_packer.h190 size_t newSize = writePos_ + writeSize; in Write() local
191 if (newSize > packSize_) { in Write()
196 newSize = (newSize + ALLOC_PAGE_SIZE - 1) & (~(ALLOC_PAGE_SIZE - 1)); in Write()
197 char *newData = new char[newSize]; in Write()
202 if (memcpy_s(newData, newSize, data_, packSize_) != EOK) { in Write()
210 packSize_ = newSize; in Write()
/drivers/hdf_core/framework/utils/src/
Dosal_message.c14 size_t newSize = sizeof(struct HdfMessage) + extendSize; in HdfMessageObtain() local
15 return (struct HdfMessage *)OsalMemCalloc(newSize); in HdfMessageObtain()
Dhdf_sbuf_impl_raw.c147 uint32_t newSize; in SbufRawImplGrow() local
154 newSize = SbufRawImplGetAlignSize(sbuf->capacity + growSize); in SbufRawImplGrow()
155 if (newSize < sbuf->capacity) { in SbufRawImplGrow()
159 if (newSize > HDF_SBUF_MAX_SIZE) { in SbufRawImplGrow()
164 newData = OsalMemCalloc(newSize); in SbufRawImplGrow()
171 if (memcpy_s(newData, newSize, sbuf->data, sbuf->writePos) != EOK) { in SbufRawImplGrow()
179 sbuf->capacity = newSize; in SbufRawImplGrow()
/drivers/hdf_core/framework/core/adapter/syscall/src/
Dhdf_syscall_adapter.c53 size_t newSize = buffer->readSize; in HdfDevEventGrowReadBuffer() local
55 if (newSize > EVENT_READ_BUFF_MAX) { in HdfDevEventGrowReadBuffer()
60 void *newBuff = OsalMemAlloc(newSize); in HdfDevEventGrowReadBuffer()
62 HDF_LOGE("%s:oom,%d", __func__, (int)newSize); in HdfDevEventGrowReadBuffer()
386 uint32_t newSize = thread->pfdSize + HDF_PFD_GROW_SIZE; in GetValidPfdIndexLocked() local
387 struct pollfd *newPfds = OsalMemCalloc(sizeof(struct pollfd) * newSize); in GetValidPfdIndexLocked()
393 … newPfds, sizeof(struct pollfd) * newSize, thread->pfds, sizeof(struct pollfd) * thread->pfdSize); in GetValidPfdIndexLocked()
396 for (uint32_t i = index; i < newSize; i++) { in GetValidPfdIndexLocked()
402 thread->pfdSize = newSize; in GetValidPfdIndexLocked()
/drivers/hdf_core/adapter/uhdf2/ipc/src/
Dhdf_sbuf_impl_hipc.cpp379 void *Realloc(void *data, size_t newSize) override in Realloc() argument
382 (void)newSize; in Realloc()
/drivers/peripheral/usb/ddk/host/src/
Dlinux_adapter.c33 static void *OsAdapterRealloc(void *ptr, size_t oldSize, size_t newSize) in OsAdapterRealloc() argument
35 void *mem = RawUsbMemAlloc(newSize); in OsAdapterRealloc()
42 if (memmove_s(mem, newSize, ptr, oldSize) != EOK) { in OsAdapterRealloc()
Dliteos_adapter.c51 static void *OsAdapterRealloc(void *ptr, size_t oldSize, size_t newSize) in OsAdapterRealloc() argument
55 mem = RawUsbMemAlloc(newSize); in OsAdapterRealloc()
62 if (memmove_s(mem, newSize, ptr, oldSize) != HDF_SUCCESS) { in OsAdapterRealloc()