[go: nahoru, domu]

Skip to content

Commit

Permalink
Remove use of SkTAddOffset and sk_careful_memcpy (#38977)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjlubick committed Jan 18, 2023
1 parent c52b290 commit 2722c54
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions display_list/display_list_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ static void CopyV(void* dst, const S* src, int n, Rest&&... rest) {
FML_DCHECK(((uintptr_t)dst & (alignof(S) - 1)) == 0)
<< "Expected " << dst << " to be aligned for at least " << alignof(S)
<< " bytes.";
sk_careful_memcpy(dst, src, n * sizeof(S));
CopyV(SkTAddOffset<void>(dst, n * sizeof(S)), std::forward<Rest>(rest)...);
// If n is 0, there is nothing to copy into dst from src.
if (n > 0) {
memcpy(dst, src, n * sizeof(S));
dst = reinterpret_cast<void*>(reinterpret_cast<uint8_t*>(dst) +
n * sizeof(S));
}
// Repeat for the next items, if any
CopyV(dst, std::forward<Rest>(rest)...);
}

static constexpr inline bool is_power_of_two(int value) {
Expand Down

0 comments on commit 2722c54

Please sign in to comment.