From 79f8cab5e28985b5b653e10b0d92384a94c59d84 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 13 Jul 2022 21:41:04 -0400 Subject: [PATCH] Attempt to reduce memory allocations. --- Concurrency/AsyncTaskQueue.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Concurrency/AsyncTaskQueue.cpp b/Concurrency/AsyncTaskQueue.cpp index 12615430e..ccc44a990 100644 --- a/Concurrency/AsyncTaskQueue.cpp +++ b/Concurrency/AsyncTaskQueue.cpp @@ -89,6 +89,7 @@ DeferringAsyncTaskQueue::~DeferringAsyncTaskQueue() { void DeferringAsyncTaskQueue::defer(std::function function) { if(!deferred_tasks_) { deferred_tasks_ = std::make_unique(); + deferred_tasks_->reserve(16); } deferred_tasks_->push_back(function); }