mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:57:44 +00:00
AK: Use kmalloc_array() where appropriate
This commit is contained in:
parent
2189524cb3
commit
3609ac4cf9
2 changed files with 3 additions and 3 deletions
|
@ -623,7 +623,7 @@ public:
|
|||
if (m_capacity >= needed_capacity)
|
||||
return true;
|
||||
size_t new_capacity = kmalloc_good_size(needed_capacity * sizeof(StorageType)) / sizeof(StorageType);
|
||||
auto* new_buffer = (StorageType*)kmalloc(new_capacity * sizeof(StorageType));
|
||||
auto* new_buffer = static_cast<StorageType*>(kmalloc_array(new_capacity, sizeof(StorageType)));
|
||||
if (new_buffer == nullptr)
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue