1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:37:47 +00:00

AK: Use __builtin_memmove for ByteBuffer and Span's overwrite

__builtin_memcpy will fail when the target area and the source area
overlap. Using __builtin_memmove will handle this case as well.
This commit is contained in:
sin-ack 2021-09-12 16:02:04 +00:00 committed by Ali Mohammad Pur
parent 59eb2d5de4
commit e4a1bc1542
2 changed files with 2 additions and 2 deletions

View file

@ -214,7 +214,7 @@ public:
{
// make sure we're not told to write past the end
VERIFY(offset + data_size <= size());
__builtin_memcpy(this->data() + offset, data, data_size);
__builtin_memmove(this->data() + offset, data, data_size);
}
void zero_fill()