mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +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
|
@ -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…
Reference in a new issue