-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug with unwanted sharing of stats between stream_config
Copying a stream_config would leave them pointing at the same vector<stream_stat_config>, with correctness consequences if either copy later adds more statistics. This happens as part of chunk_stream::adjust_config. This could also lead to race conditions if a config was modified after constructing a stream with it, since it would affect and stream_stats instances that it shared with. The type has been changed to shared_ptr<const vector<...>> throughout to prevent modifying shared data. This makes add_stat much less efficient (it copies the vector every time) but that is not on the critical path.
- Loading branch information
Showing
3 changed files
with
29 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters