mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 21:22:48 +00:00
CommandQueueMT: Pre-allocate memory to avoid a bunch of allocations at startup
This commit is contained in:
parent
c4279fe3e0
commit
c0529dc4f2
@ -42,6 +42,7 @@ void CommandQueueMT::unlock() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CommandQueueMT::CommandQueueMT() {
|
CommandQueueMT::CommandQueueMT() {
|
||||||
|
command_mem.reserve(DEFAULT_COMMAND_MEM_SIZE_KB * 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandQueueMT::~CommandQueueMT() {
|
CommandQueueMT::~CommandQueueMT() {
|
||||||
|
@ -325,9 +325,7 @@ class CommandQueueMT {
|
|||||||
|
|
||||||
/***** BASE *******/
|
/***** BASE *******/
|
||||||
|
|
||||||
enum {
|
static const uint32_t DEFAULT_COMMAND_MEM_SIZE_KB = 64;
|
||||||
DEFAULT_COMMAND_MEM_SIZE_KB = 256,
|
|
||||||
};
|
|
||||||
|
|
||||||
BinaryMutex mutex;
|
BinaryMutex mutex;
|
||||||
LocalVector<uint8_t> command_mem;
|
LocalVector<uint8_t> command_mem;
|
||||||
|
Loading…
Reference in New Issue
Block a user