Skip to content

Commit ed35fda

Browse files
committed
fixup! Reduce enqueue overhead
1 parent aeb2000 commit ed35fda

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/stream_outlet_impl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ stream_outlet_impl::stream_outlet_impl(const stream_info_impl &info, int32_t chu
2929
if ((info.channel_format() == cft_string) && do_sync_)
3030
throw std::invalid_argument("Synchronous push not supported for string-formatted streams.");
3131

32+
// reserver space for sync timestamps so `push_back` doesn't caused reallocations
33+
// to invalidate pointers to elements
34+
if(do_sync_) sync_timestamps_.reserve(chunk_size_);
35+
3236
ensure_lsl_initialized();
3337
const api_config *cfg = api_config::get_instance();
3438

0 commit comments

Comments
 (0)