Skip to content

Commit

Permalink
No need to recreate history if capacity is sufficient...
Browse files Browse the repository at this point in the history
  • Loading branch information
frankosterfeld committed Jun 23, 2023
1 parent 59e7b69 commit 8ad69c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/data_sink.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,9 @@ class data_sink : public node<data_sink<T>> {

void
ensure_history_size(std::size_t new_size) {
if (new_size <= history.capacity()) {
return;
}
// TODO transitional, do not reallocate/copy, but create a shared buffer with size N,
// and a per-listener history buffer where more than N samples is needed.
auto new_history = gr::history_buffer<T>(std::max(new_size, history.capacity()));
Expand Down

0 comments on commit 8ad69c3

Please sign in to comment.