Skip to content

Commit 2d7ae51

Browse files
authored
Avoid unnecessary and expensive getLastWriteTime calls for memory mapped files on windows
Signed-off-by: jjtParadox <[email protected]>
1 parent 5ff0edc commit 2d7ae51

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

openvdb/openvdb/io/Archive.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ MappedFile::filename() const
554554
SharedPtr<std::streambuf>
555555
MappedFile::createBuffer() const
556556
{
557+
#ifndef _WIN32
557558
if (!mImpl->mAutoDelete && mImpl->mLastWriteTime > 0) {
558559
// Warn if the file has been modified since it was opened
559560
// (but don't bother checking if it is a private, temporary file).
@@ -563,6 +564,7 @@ MappedFile::createBuffer() const
563564
mImpl->mLastWriteTime = 0; // suppress further warnings
564565
}
565566
}
567+
#endif
566568

567569
return SharedPtr<std::streambuf>{
568570
new boost::iostreams::stream_buffer<boost::iostreams::array_source>{

0 commit comments

Comments
 (0)