mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:08:10 +00:00
AK: Add Vector::unchecked_append for data pointers
This mirrors the existence of append() for data pointers and is very useful when the program needs to have a guarantee of no allocations, as is necessary for real-time audio.
This commit is contained in:
parent
9c40311622
commit
05cb499d58
1 changed files with 9 additions and 0 deletions
|
@ -253,6 +253,15 @@ public:
|
|||
++m_size;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void unchecked_append(StorageType const* values, size_t count)
|
||||
{
|
||||
if (count == 0)
|
||||
return;
|
||||
VERIFY((size() + count) <= capacity());
|
||||
TypedTransfer<StorageType>::copy(slot(m_size), values, count);
|
||||
m_size += count;
|
||||
}
|
||||
|
||||
template<class... Args>
|
||||
void empend(Args&&... args) requires(!contains_reference)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue