1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

AK: Use __builtin_memset() and such to reduce header dependencies

We can use __builtin_memset() without including <string.h>.
This is pretty neat, as it will allow us to reduce the header deps
of AK templates a bit, if applied consistently.

Note that this is an enabling change for an upcoming #include removal.
This commit is contained in:
Andreas Kling 2020-03-08 11:57:24 +01:00
parent b1058b33fb
commit 35d88f536c
5 changed files with 14 additions and 14 deletions

View file

@ -112,7 +112,7 @@ public:
fill(default_value);
if (previous_data != nullptr) {
memcpy(m_data, previous_data, previous_size_bytes);
__builtin_memcpy(m_data, previous_data, previous_size_bytes);
if ((previous_size % 8) != 0) {
if (default_value)
@ -127,7 +127,7 @@ public:
void fill(bool value)
{
memset(m_data, value ? 0xff : 0x00, size_in_bytes());
__builtin_memset(m_data, value ? 0xff : 0x00, size_in_bytes());
}
Optional<size_t> find_first_set() const