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])); 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" printf("\n"
<< (int)vase.length() << " bytes\n" "%lu bytes\n"
<< (int)vase.root->lines << " lines\n" "%lu lines\n"
<< (int)matches.size() << " matches\n" "\n",
<< "\n"; vase.length(),
vase.root->lines);
return 0; return 0;
} }
+1
View File
@@ -26,6 +26,7 @@ void OriginalBuffer::initialize() {
buf = nullptr; buf = nullptr;
throw std::runtime_error("mmap failed"); throw std::runtime_error("mmap failed");
} }
madvise((void *)buf, len, MADV_RANDOM);
close(fd); close(fd);
fd = -1; fd = -1;
} }