@@ -106,7 +106,7 @@ void arrayCopyCapped(WpArray dst, const WpArray src, u64 item_size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
WpArray arrayAppendAlloc(const WpAllocator *allocator, WpArray array, void *value,
|
WpArray arrayAppendAlloc(const WpAllocator *allocator, WpArray array, void *value,
|
||||||
WpArrayInitFlags flags, u64 item_size) {
|
WpArrayInitFlags flags, u64 item_size) {
|
||||||
wpRuntimeAssert(allocator != NULL && array != NULL, "`allocator` and `array` should not be NULL");
|
wpRuntimeAssert(allocator != NULL && array != NULL, "`allocator` and `array` should not be NULL");
|
||||||
arrayValidate(array, item_size);
|
arrayValidate(array, item_size);
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ RETURN_ARRAY_APPEND_ALLOC:
|
|||||||
}
|
}
|
||||||
|
|
||||||
WpArray arrayExtendAlloc(const WpAllocator *allocator, WpArray dst, const WpArray src,
|
WpArray arrayExtendAlloc(const WpAllocator *allocator, WpArray dst, const WpArray src,
|
||||||
WpArrayInitFlags flags, u64 item_size) {
|
WpArrayInitFlags flags, u64 item_size) {
|
||||||
wpRuntimeAssert(allocator != NULL && dst != NULL && src != NULL, "`allocator`, `dst` and `src` should not be NULL");
|
wpRuntimeAssert(allocator != NULL && dst != NULL && src != NULL, "`allocator`, `dst` and `src` should not be NULL");
|
||||||
arrayValidate(dst, item_size);
|
arrayValidate(dst, item_size);
|
||||||
arrayValidate(src, item_size);
|
arrayValidate(src, item_size);
|
||||||
@@ -167,7 +167,7 @@ RETURN_ARRAY_EXTEND_ALLOC:
|
|||||||
}
|
}
|
||||||
|
|
||||||
WpArray arrayCopyAlloc(const WpAllocator *allocator, WpArray dst, const WpArray src,
|
WpArray arrayCopyAlloc(const WpAllocator *allocator, WpArray dst, const WpArray src,
|
||||||
WpArrayInitFlags flags, u64 item_size) {
|
WpArrayInitFlags flags, u64 item_size) {
|
||||||
wpRuntimeAssert(allocator != NULL && dst != NULL && src != NULL, "`allocator`, `dst` and `src` should not be NULL");
|
wpRuntimeAssert(allocator != NULL && dst != NULL && src != NULL, "`allocator`, `dst` and `src` should not be NULL");
|
||||||
arrayValidate(dst, item_size);
|
arrayValidate(dst, item_size);
|
||||||
arrayValidate(src, item_size);
|
arrayValidate(src, item_size);
|
||||||
@@ -247,7 +247,7 @@ u64 arrayCalcAllocSize(u64 capacity, u64 item_size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
WpArray arrayAllocCapacity(const WpAllocator *allocator, u64 capacity, WpArrayInitFlags flags,
|
WpArray arrayAllocCapacity(const WpAllocator *allocator, u64 capacity, WpArrayInitFlags flags,
|
||||||
u64 item_size) {
|
u64 item_size) {
|
||||||
wpRuntimeAssert(allocator != NULL, "`allocator` should not be NULL");
|
wpRuntimeAssert(allocator != NULL, "`allocator` should not be NULL");
|
||||||
|
|
||||||
WpArray output = NULL;
|
WpArray output = NULL;
|
||||||
@@ -266,7 +266,7 @@ RETURN_ARRAY_ALLOC:
|
|||||||
|
|
||||||
|
|
||||||
WpArray arrayFromPreallocatedBuffer(void *buffer, u64 buffer_size, WpArrayInitFlags flags,
|
WpArray arrayFromPreallocatedBuffer(void *buffer, u64 buffer_size, WpArrayInitFlags flags,
|
||||||
u64 item_size) {
|
u64 item_size) {
|
||||||
wpRuntimeAssert(buffer != NULL, "`buffer` should not be NULL");
|
wpRuntimeAssert(buffer != NULL, "`buffer` should not be NULL");
|
||||||
|
|
||||||
i64 data_buffer_size = (i64)buffer_size - (i64)(sizeof(WpArrayHeader));
|
i64 data_buffer_size = (i64)buffer_size - (i64)(sizeof(WpArrayHeader));
|
||||||
|
|||||||
Reference in New Issue
Block a user