mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
replace memcpy with std::copy
This commit is contained in:
parent
0f61853a37
commit
a2e66e31d2
@ -115,28 +115,36 @@ void write_out(scatter_full_plan *plan_out, void *aux_out,
|
|||||||
plan_out->s_u64a_offset = aux_base_offset;
|
plan_out->s_u64a_offset = aux_base_offset;
|
||||||
plan_out->s_u64a_count = raw.p_u64a.size();
|
plan_out->s_u64a_count = raw.p_u64a.size();
|
||||||
assert(ISALIGNED_N(static_cast<char *>(aux_out) + aux_base_offset, alignof(scatter_unit_u64a)));
|
assert(ISALIGNED_N(static_cast<char *>(aux_out) + aux_base_offset, alignof(scatter_unit_u64a)));
|
||||||
memcpy(static_cast<char *>(aux_out) + aux_base_offset, raw.p_u64a.data(), byte_length(raw.p_u32));
|
auto *start = reinterpret_cast<const char *>(raw.p_u64a.data());
|
||||||
|
auto *to = static_cast<char *>(aux_out) + aux_base_offset;
|
||||||
|
std::copy(start, start + byte_length(raw.p_u64a), to);
|
||||||
aux_base_offset += byte_length(raw.p_u64a);
|
aux_base_offset += byte_length(raw.p_u64a);
|
||||||
}
|
}
|
||||||
if (!raw.p_u32.empty()) {
|
if (!raw.p_u32.empty()) {
|
||||||
plan_out->s_u32_offset = aux_base_offset;
|
plan_out->s_u32_offset = aux_base_offset;
|
||||||
plan_out->s_u32_count = raw.p_u32.size();
|
plan_out->s_u32_count = raw.p_u32.size();
|
||||||
assert(ISALIGNED_N(static_cast<char *>(aux_out) + aux_base_offset, alignof(scatter_unit_u32)));
|
assert(ISALIGNED_N(static_cast<char *>(aux_out) + aux_base_offset, alignof(scatter_unit_u32)));
|
||||||
memcpy(static_cast<char *>(aux_out) + aux_base_offset, raw.p_u32.data(), byte_length(raw.p_u32));
|
auto *start = reinterpret_cast<const char *>(raw.p_u32.data());
|
||||||
|
auto *to = static_cast<char *>(aux_out) + aux_base_offset;
|
||||||
|
std::copy(start, start + byte_length(raw.p_u32), to);
|
||||||
aux_base_offset += byte_length(raw.p_u32);
|
aux_base_offset += byte_length(raw.p_u32);
|
||||||
}
|
}
|
||||||
if (!raw.p_u16.empty()) {
|
if (!raw.p_u16.empty()) {
|
||||||
plan_out->s_u16_offset = aux_base_offset;
|
plan_out->s_u16_offset = aux_base_offset;
|
||||||
plan_out->s_u16_count = raw.p_u16.size();
|
plan_out->s_u16_count = raw.p_u16.size();
|
||||||
assert(ISALIGNED_N(static_cast<char *>(aux_out) + aux_base_offset, alignof(scatter_unit_u16)));
|
assert(ISALIGNED_N(static_cast<char *>(aux_out) + aux_base_offset, alignof(scatter_unit_u16)));
|
||||||
memcpy(static_cast<char *>(aux_out) + aux_base_offset, raw.p_u16.data(), byte_length(raw.p_u16));
|
auto *start = reinterpret_cast<const char *>(raw.p_u16.data());
|
||||||
|
auto *to = static_cast<char *>(aux_out) + aux_base_offset;
|
||||||
|
std::copy(start, start + byte_length(raw.p_u16), to);
|
||||||
aux_base_offset += byte_length(raw.p_u16);
|
aux_base_offset += byte_length(raw.p_u16);
|
||||||
}
|
}
|
||||||
if (!raw.p_u8.empty()) {
|
if (!raw.p_u8.empty()) {
|
||||||
plan_out->s_u8_offset = aux_base_offset;
|
plan_out->s_u8_offset = aux_base_offset;
|
||||||
plan_out->s_u8_count = raw.p_u8.size();
|
plan_out->s_u8_count = raw.p_u8.size();
|
||||||
assert(ISALIGNED_N(static_cast<char *>(aux_out) + aux_base_offset, alignof(scatter_unit_u8)));
|
assert(ISALIGNED_N(static_cast<char *>(aux_out) + aux_base_offset, alignof(scatter_unit_u8)));
|
||||||
memcpy(static_cast<char *>(aux_out) + aux_base_offset, raw.p_u8.data(), byte_length(raw.p_u8));
|
auto *start = reinterpret_cast<const char *>(raw.p_u8.data());
|
||||||
|
auto *to = static_cast<char *>(aux_out) + aux_base_offset;
|
||||||
|
std::copy(start, start + byte_length(raw.p_u8), to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user