This commit is contained in:
2026-08-04 09:41:57 +01:00
parent e253fa0efb
commit 1f57c40eef
2 changed files with 9 additions and 6 deletions
+8 -6
View File
@@ -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;
}
+1
View File
@@ -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;
}