1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Attempt to reduce memory allocations.

This commit is contained in:
Thomas Harte 2022-07-13 21:41:04 -04:00
parent 92efad4970
commit 79f8cab5e2

View File

@ -89,6 +89,7 @@ DeferringAsyncTaskQueue::~DeferringAsyncTaskQueue() {
void DeferringAsyncTaskQueue::defer(std::function<void(void)> function) {
if(!deferred_tasks_) {
deferred_tasks_ = std::make_unique<TaskList>();
deferred_tasks_->reserve(16);
}
deferred_tasks_->push_back(function);
}