MCPcopy Create free account
hub / github.com/alibaba/GraphScope / reset

Method reset

flex/utils/mmap_array.h:84–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 ~mmap_array() { reset(); }
83
84 void reset() {
85 if (data_ != NULL && mmap_size_ != 0) {
86 if (munmap(data_, mmap_size_) != 0) {
87 std::stringstream ss;
88 ss << "Failed to mummap file [ " << filename_ << " ] "
89 << strerror(errno);
90 LOG(ERROR) << ss.str();
91 throw std::runtime_error(ss.str());
92 }
93 }
94 data_ = NULL;
95 size_ = 0;
96 mmap_size_ = 0;
97 if (fd_ != -1) {
98 if (close(fd_) != 0) {
99 std::stringstream ss;
100 ss << "Failed to close file [ " << filename_ << " ] "
101 << strerror(errno);
102 LOG(ERROR) << ss.str();
103 throw std::runtime_error(ss.str());
104 }
105 fd_ = -1;
106 }
107 filename_ = "";
108 sync_to_file_ = false;
109 }
110
111 void unlink() {
112 std::string old_filename = filename_;

Callers 1

resetMethod · 0.45

Calls 2

closeFunction · 0.85
strMethod · 0.45

Tested by

no test coverage detected