Cleanup
This commit is contained in:
+8
-6
@@ -9,13 +9,15 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
Vase vase = Vase(std::string(argv[1]));
|
||||
|
||||
auto matches = vase.regex_search("hello", {{0, 0}, {vase.root->lines, UINT64_MAX}}, "g");
|
||||
Point p = {500, 1000};
|
||||
vase.insert(&p, 'x');
|
||||
|
||||
std::cout << "\n"
|
||||
<< (int)vase.length() << " bytes\n"
|
||||
<< (int)vase.root->lines << " lines\n"
|
||||
<< (int)matches.size() << " matches\n"
|
||||
<< "\n";
|
||||
printf("\n"
|
||||
"%lu bytes\n"
|
||||
"%lu lines\n"
|
||||
"\n",
|
||||
vase.length(),
|
||||
vase.root->lines);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ void OriginalBuffer::initialize() {
|
||||
buf = nullptr;
|
||||
throw std::runtime_error("mmap failed");
|
||||
}
|
||||
madvise((void *)buf, len, MADV_RANDOM);
|
||||
close(fd);
|
||||
fd = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user