msg_debug_hyperscan_lambda("multipattern: create new database in %s; %Hz size",
tmpfile_pattern.data(), unserialized_size);
void *buf;
- posix_memalign(&buf, 16, unserialized_size);
+#ifdef HAVE_GETPAGESIZE
+ auto page_size = getpagesize();
+#else
+ auto page_size = sysconf(_SC_PAGESIZE);
+#endif
+ if (page_size == -1) {
+ page_size = 4096;
+ }
+ posix_memalign(&buf, page_size, unserialized_size);
if (buf == nullptr) {
return tl::make_unexpected(error {"Cannot allocate memory", errno, error_category::CRITICAL });
}