mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 21:54:40 +03:00
AK: Use kfree_sized() in AK::Bitmap
This commit is contained in:
parent
875afb35c3
commit
6950dd220b
Notes:
sideshowbarker
2024-07-18 09:20:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6950dd220bc
@ -49,7 +49,7 @@ public:
|
||||
Bitmap& operator=(Bitmap&& other)
|
||||
{
|
||||
if (this != &other) {
|
||||
kfree(m_data);
|
||||
kfree_sized(m_data, size_in_bytes());
|
||||
m_data = exchange(other.m_data, nullptr);
|
||||
m_size = exchange(other.m_size, 0);
|
||||
}
|
||||
@ -59,7 +59,7 @@ public:
|
||||
~Bitmap()
|
||||
{
|
||||
if (m_is_owning) {
|
||||
kfree(m_data);
|
||||
kfree_sized(m_data, size_in_bytes());
|
||||
}
|
||||
m_data = nullptr;
|
||||
}
|
||||
@ -107,7 +107,7 @@ public:
|
||||
__builtin_memcpy(m_data, previous_data, previous_size_bytes);
|
||||
if (previous_size % 8)
|
||||
set_range(previous_size, 8 - previous_size % 8, default_value);
|
||||
kfree(previous_data);
|
||||
kfree_sized(previous_data, previous_size_bytes);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user