diff --git a/bloomfilter.h b/bloomfilter.h index 5534928..ea09a31 100644 --- a/bloomfilter.h +++ b/bloomfilter.h @@ -63,11 +63,13 @@ class BF { _mode(0), _bf(size, 0) { +#ifdef MADV_HUGEPAGE char* const sptr = reinterpret_cast(_bf.data()); const size_t soffset = SHARK_HUGEPAGESIZE - (reinterpret_cast(sptr) % SHARK_HUGEPAGESIZE); char* const eptr = sptr + (((size + 63) >> 6) << 3); const size_t eoffset = (reinterpret_cast(eptr) % SHARK_HUGEPAGESIZE); madvise(sptr + soffset, (eptr - sptr) - eoffset - soffset, MADV_HUGEPAGE); +#endif } ~BF() {}