Set up a pipe with an OutputStream at one end and a BackgroundReader at the other end.
| 186 | // Set up a pipe with an OutputStream at one end and a BackgroundReader at |
| 187 | // the other end. |
| 188 | static void SetupPipeWriter(std::shared_ptr<io::OutputStream>* stream, |
| 189 | std::shared_ptr<BackgroundReader>* reader) { |
| 190 | auto pipe = *internal::CreatePipe(); |
| 191 | *stream = *io::FileOutputStream::Open(pipe.wfd.Detach()); |
| 192 | *reader = BackgroundReader::StartReader(pipe.rfd.Detach()); |
| 193 | } |
| 194 | |
| 195 | static void BenchmarkStreamingWrites(benchmark::State& state, |
| 196 | const std::valarray<int64_t>& sizes, |
no test coverage detected