| 94 | } |
| 95 | |
| 96 | void MessageQueue::MemoryAllocator::free(uint8_t *const chunk) noexcept { |
| 97 | if (_chunkCount.load(std::memory_order_acquire) >= MEMORY_CHUNK_POOL_CAPACITY) { |
| 98 | memoryFreeForMultiThread(chunk); |
| 99 | } else { |
| 100 | _chunkPool.enqueue(chunk); |
| 101 | _chunkCount.fetch_add(1, std::memory_order_acq_rel); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | MessageQueue::MessageQueue() { |
| 106 | uint8_t *const chunk = MemoryAllocator::getInstance().request(); |
nothing calls this directly
no test coverage detected