MCPcopy Create free account
hub / github.com/apache/arrow / ZeroMemoryMap

Function ZeroMemoryMap

cpp/src/arrow/io/test_common.cc:76–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76Status 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
93void MemoryMapFixture::TearDown() {
94 for (auto path : tmp_files_) {

Callers 1

DoLargeRoundTripMethod · 0.85

Calls 3

OKFunction · 0.50
SeekMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected