File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -562,7 +562,11 @@ bool map::resize_(size_t size) NOEXCEPT
562562 // TODO: implement fallocate for macOS (open and write a byte per block).
563563 if (::ftruncate (opened_, size) == fail)
564564#else
565+ #if defined (WITH_FALLOCATE)
565566 if (::fallocate (opened_, 0 , capacity_, size - capacity_) == fail)
567+ #else
568+ if (::ftruncate (opened_, size) == fail)
569+ #endif
566570#endif
567571 {
568572 // Disk full is the only restartable store failure (leave mapped).
@@ -594,6 +598,7 @@ bool map::finalize_(size_t size) NOEXCEPT
594598 return false ;
595599 }
596600
601+ #if defined (WITH_MADVISE)
597602#if !defined(HAVE_MSC)
598603 // Get page size (usually 4KB).
599604 const int page_size = ::sysconf (_SC_PAGESIZE);
@@ -629,6 +634,7 @@ bool map::finalize_(size_t size) NOEXCEPT
629634 }
630635 }
631636#endif
637+ #endif // WITH_MADVISE
632638
633639 loaded_ = true ;
634640 capacity_ = size;
You can’t perform that action at this time.
0 commit comments