mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
wpiutil: uv: Remove copy from SimpleBufferPool (#1680)
This commit is contained in:
committed by
Peter Johnson
parent
620bec9cae
commit
1726b77ac5
@@ -133,7 +133,8 @@ static void SetupUdp(wpi::uv::Loop& loop) {
|
||||
outAddr.sin_port = htons(1150);
|
||||
|
||||
wpi::SmallVector<wpi::uv::Buffer, 4> sendBufs;
|
||||
wpi::raw_uv_ostream stream{sendBufs, GetBufferPool()};
|
||||
wpi::raw_uv_ostream stream{sendBufs,
|
||||
[] { return GetBufferPool().Allocate(); }};
|
||||
ds->SetupSendBuffer(stream);
|
||||
|
||||
udpLocal->Send(outAddr, sendBufs, [](auto bufs, Error err) {
|
||||
|
||||
@@ -108,6 +108,9 @@ class SimpleBufferPool {
|
||||
*/
|
||||
explicit SimpleBufferPool(size_t size = 4096) : m_size{size} {}
|
||||
|
||||
SimpleBufferPool(const SimpleBufferPool& other) = delete;
|
||||
SimpleBufferPool& operator=(const SimpleBufferPool& other) = delete;
|
||||
|
||||
/**
|
||||
* Allocate a buffer.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user