ardupilot/libraries/AP_HAL/utility
Leandro Pereira fbefe32017 AP_HAL: Add method to reserve space in the ring buffer
Adds a method called `reserve()`, that will take a ByteBuffer::IoVec
array of at least two elements, and return the number of elements
filled out.  0 will be returned if `len` is over the total space of
the buffer; 1 will be returned if there's enough contiguous bytes in
the buffer; 2 will be returned if there are two non-contiguous blocks
of memory.

This method is suitable to be used with POSIX system calls such as
readv(), and is an optimization to not require temporary memory copies
while reading from a file descriptor.

Also modify the write() method to use reserve(), so that similar checks
are performed only in one place.
2016-07-08 13:10:16 -03:00
..
tests AP_HAL: fix signed and unsigned comparison warning 2016-05-04 08:58:37 -03:00
BetterStream.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
dsm.cpp AP_HAL: moved dsm implementation into AP_HAL/utility 2015-12-27 16:12:27 +11:00
dsm.h AP_HAL: moved dsm implementation into AP_HAL/utility 2015-12-27 16:12:27 +11:00
ftoa_engine.cpp AP_HAL: ftoa_engine: replace tabs with spaces 2015-12-27 15:58:12 -02:00
ftoa_engine.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
functor.h AP_HAL: functor: use std::remove_reference 2016-02-16 19:49:09 -02:00
getopt_cpp.cpp AP_HAL: allow getopt_cpp on QURT 2015-12-29 19:10:46 +11:00
getopt_cpp.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
OwnPtr.h AP_HAL: utility: Add OwnPtr implementation 2016-02-16 19:49:08 -02:00
print_vprintf.cpp Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00
print_vprintf.h AP_HAL: remove unused in_progmem flag to print_vprintf 2015-12-27 15:58:12 -02:00
Print.cpp AP_HAL: standardize inclusion of libaries headers 2015-08-18 17:12:51 +10:00
Print.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
RingBuffer.cpp AP_HAL: Add method to reserve space in the ring buffer 2016-07-08 13:10:16 -03:00
RingBuffer.h AP_HAL: Add method to reserve space in the ring buffer 2016-07-08 13:10:16 -03:00
Socket.cpp AP_HAL: standardize inclusion of libaries headers 2015-08-11 16:28:43 +10:00
Socket.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
sparse-endian.h AP_HAL: sparse-endian: conditionally include byteswap header 2016-03-23 17:50:38 -03:00
Stream.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
utoa_invert.cpp AP_HAL: support %lld and %llu in internal printf 2015-05-27 11:54:17 +10:00
xtoa_fast.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00