12 size_t source_offset, int32_t *destination,
13 size_t destination_elements,
14 size_t destination_offset,
size_t count) {
15 if (!
count || source_offset > source_elements ||
16 count > source_elements - source_offset ||
17 destination_offset > destination_elements ||
18 count > destination_elements - destination_offset)
23 const uintptr_t src = (uintptr_t)(source + source_offset);
24 const uintptr_t dst = (uintptr_t)(destination + destination_offset);
25 const size_t bytes =
count *
sizeof(int32_t);
26 if (src < dst + bytes && dst < src + bytes)
28 memcpy(destination + destination_offset, source + source_offset, bytes);
int ck_copy_i32_span_checked(const int32_t *source, size_t source_elements, size_t source_offset, int32_t *destination, size_t destination_elements, size_t destination_offset, size_t count)