+#ifdef HAVE_HUGE_PAGES
+
+ if (alignmentBytes % 4096 == 0) {
+ ret = madvise(*ptr, bytesToAlloc, MADV_HUGEPAGE);
+
+ if (ret != 0) {
+ DEBUG_BREAK_POINT();
+ Error("madvise(%p, %lu, MADV_HUGEPAGE) failed: %d - %s.\n", *ptr, bytesToAlloc, errno, strerror(errno));
+ exit(1);
+ }
+ }
+#endif
+