mirror of https://github.com/ArduPilot/ardupilot
e3b676ba89
Modify ByteBuffer class to have a `peekiovec()` method, that takes in a `struct IoVec` array (similar to `struct iovec` from POSIX), and a number of bytes, and returns the number of elements from this array that have been filled out. It is either 0 (buffer is empty), 1 (there's enough contiguous bytes to read that amount) or 2 (ring buffer is wrapping around). This enables using scatter-gather I/O (i.e. writev()), removing calls to memcpy(). That's one call when no wrap-around is happening, and two calls if it is. Also, rewrite `ByteBuffer::peekbytes()` to use `peekiovec()`, so that some of the checks performed by the former are not replicated in the latter. |
||
---|---|---|
.. | ||
tests | ||
BetterStream.h | ||
OwnPtr.h | ||
Print.cpp | ||
Print.h | ||
RingBuffer.cpp | ||
RingBuffer.h | ||
Socket.cpp | ||
Socket.h | ||
Stream.h | ||
dsm.cpp | ||
dsm.h | ||
ftoa_engine.cpp | ||
ftoa_engine.h | ||
functor.h | ||
getopt_cpp.cpp | ||
getopt_cpp.h | ||
print_vprintf.cpp | ||
print_vprintf.h | ||
sparse-endian.h | ||
utoa_invert.cpp | ||
xtoa_fast.h |