1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Merge pull request #91727 from RandomShaper/cmd_queue_prealloc

`CommandQueueMT`: Pre-allocate memory to avoid a bunch of allocations at startup
This commit is contained in:
Rémi Verschelde
2024-05-10 09:55:57 +02:00
2 changed files with 2 additions and 3 deletions

View File

@@ -42,6 +42,7 @@ void CommandQueueMT::unlock() {
}
CommandQueueMT::CommandQueueMT() {
command_mem.reserve(DEFAULT_COMMAND_MEM_SIZE_KB * 1024);
}
CommandQueueMT::~CommandQueueMT() {

View File

@@ -325,9 +325,7 @@ class CommandQueueMT {
/***** BASE *******/
enum {
DEFAULT_COMMAND_MEM_SIZE_KB = 256,
};
static const uint32_t DEFAULT_COMMAND_MEM_SIZE_KB = 64;
BinaryMutex mutex;
LocalVector<uint8_t> command_mem;