mmp / pbrt-v3

Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
http://pbrt.org
BSD 2-Clause "Simplified" License
4.88k stars 1.19k forks source link

Make the parser use file memory-mapping on Windows too. #175

Closed Scylardor closed 6 years ago

Scylardor commented 6 years ago

Some thoughts on this:

I could only test on my personal Windows 10, sorry!. But as it's pretty classic windows API, I expect this to work smoothly with older versions of Windows.

Scylardor commented 6 years ago

I wrote a fix for the tests because the parser wasn't checking for '\r' in comments (\r\n line endings on windows) so it had a \r after what it expected.

And the other issue was that the parser test failed to remove the test file because the tokenizer was still holding to its mapping view of the file. So, I enclosed it in a scope to destroy it before attempting to remove the file.

mmp commented 6 years ago

This looks great--thanks for doing this!

I'll hold off merging until all of the appveyor builds finish successfully; I assume the current run will be good.