logger: make sure the buffer is at least 300B larger than _min_write_chunk

We always write larger chunks (orb messages) to the buffer, so the buffer
needs to be larger than the minimum write chunk
This commit is contained in:
Beat Küng 2016-05-06 11:47:13 +02:00 committed by Lorenz Meier
parent 9a02dbdd66
commit 7d42a648f0

View File

@ -12,7 +12,9 @@ constexpr size_t LogWriter::_min_write_chunk;
LogWriter::LogWriter(size_t buffer_size) :
_buffer_size(math::max(buffer_size, _min_write_chunk))
//We always write larger chunks (orb messages) to the buffer, so the buffer
//needs to be larger than the minimum write chunk (300 is somewhat arbitrary)
_buffer_size(math::max(buffer_size, _min_write_chunk + 300))
{
pthread_mutex_init(&_mtx, nullptr);
pthread_cond_init(&_cv, nullptr);