| 74 | } |
| 75 | |
| 76 | Status ZeroMemoryMap(MemoryMappedFile* file) { |
| 77 | constexpr int64_t kBufferSize = 512; |
| 78 | static constexpr uint8_t kZeroBytes[kBufferSize] = {0}; |
| 79 | |
| 80 | RETURN_NOT_OK(file->Seek(0)); |
| 81 | int64_t position = 0; |
| 82 | ARROW_ASSIGN_OR_RAISE(int64_t file_size, file->GetSize()); |
| 83 | |
| 84 | int64_t chunksize; |
| 85 | while (position < file_size) { |
| 86 | chunksize = std::min(kBufferSize, file_size - position); |
| 87 | RETURN_NOT_OK(file->Write(kZeroBytes, chunksize)); |
| 88 | position += chunksize; |
| 89 | } |
| 90 | return Status::OK(); |
| 91 | } |
| 92 | |
| 93 | void MemoryMapFixture::TearDown() { |
| 94 | for (auto path : tmp_files_) { |
no test coverage detected