diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-02-16 12:51:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-16 12:51:17 +0100 |
commit | 274d7cd632e1a1886372935721ccf2642b34b9a3 (patch) | |
tree | c38a1f02d7d74724cd64f4a3da7a93ce16114380 /core/command_queue_mt.cpp | |
parent | 2293559c9f59c1bc3016d8aec1e0c412bc415eb0 (diff) | |
parent | 24e7a54cd0643ef9bfe2c22bc9099bba8f81f584 (diff) |
Merge pull request #25927 from hpvb/fix-21725
Fix alignment and locking issues with CommandQueueMT
Diffstat (limited to 'core/command_queue_mt.cpp')
-rw-r--r-- | core/command_queue_mt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/command_queue_mt.cpp b/core/command_queue_mt.cpp index 36d4b0a32f..2bdf02295c 100644 --- a/core/command_queue_mt.cpp +++ b/core/command_queue_mt.cpp @@ -97,7 +97,7 @@ tryagain: return false; } - dealloc_ptr += (size >> 1) + sizeof(uint32_t); + dealloc_ptr += (size >> 1) + 8; return true; } @@ -107,6 +107,7 @@ CommandQueueMT::CommandQueueMT(bool p_sync) { write_ptr = 0; dealloc_ptr = 0; mutex = Mutex::create(); + command_mem = (uint8_t *)memalloc(COMMAND_MEM_SIZE); for (int i = 0; i < SYNC_SEMAPHORES; i++) { @@ -128,4 +129,5 @@ CommandQueueMT::~CommandQueueMT() { memdelete(sync_sems[i].sem); } + memfree(command_mem); } |