mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Shave off buffer copies in networking code (#11607)
This commit is contained in:
parent
ea250ff5c5
commit
fd8a8501bc
8 changed files with 126 additions and 92 deletions
|
@ -140,6 +140,13 @@ public:
|
|||
m_signal.post();
|
||||
}
|
||||
|
||||
void push_back(T &&t)
|
||||
{
|
||||
MutexAutoLock lock(m_mutex);
|
||||
m_queue.push_back(std::move(t));
|
||||
m_signal.post();
|
||||
}
|
||||
|
||||
/* this version of pop_front returns a empty element of T on timeout.
|
||||
* Make sure default constructor of T creates a recognizable "empty" element
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue