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:
parent
92efad4970
commit
79f8cab5e2
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user