| ... | @@ -19089,7 +19089,7 @@ fn createFileMap( | ... | @@ -19089,7 +19089,7 @@ fn createFileMap( |
| 19089 | page, | 19089 | page, |
| 19090 | .{ | 19090 | .{ |
| 19091 | // Required when calling NtCreateSection with a file handle, otherwise | 19091 | // Required when calling NtCreateSection with a file handle, otherwise |
| 19092 | // this call will fail with INVALID_PARAMETER. The higher level | 19092 | // this call will fail with INVALID_PARAMETER_6. The higher level |
| 19093 | // `CreateFileMapping` function will set this bit for you when it | 19093 | // `CreateFileMapping` function will set this bit for you when it |
| 19094 | // calls NtCreateSection. | 19094 | // calls NtCreateSection. |
| 19095 | .COMMIT = true, | 19095 | .COMMIT = true, |
| ... | @@ -19140,11 +19140,13 @@ fn createFileMap( | ... | @@ -19140,11 +19140,13 @@ fn createFileMap( |
| 19140 | .TO_WORKING_SET = false, | 19140 | .TO_WORKING_SET = false, |
| 19141 | }, | 19141 | }, |
| 19142 | }; | 19142 | }; |
| 19143 | // It appears that this is effectively a no-op, as it doesn't decrease page/hard faults. | 19143 | // There has been some doubt about the efficacy of this function: |
| 19144 | // https://github.com/microsoft/Windows-Dev-Performance/issues/108 | 19144 | // https://github.com/microsoft/Windows-Dev-Performance/issues/108 |
| 19145 | // | 19145 | // |
| 19146 | // We still call it, though, to signal the intention of doing something useful. | 19146 | // However, through testing it has been shown that, if the mapped file is not |
| 19147 | // It doesn't appear to make anything *worse*, so there's no harm in doing so. | 19147 | // in the cache, calling this function can turn what might otherwise be hard |
| | 19148 | // faults into soft faults. Either way, it's still good to call it in order to |
| | 19149 | // accurately reflect our intent. |
| 19148 | switch (windows.ntdll.NtSetInformationVirtualMemory( | 19150 | switch (windows.ntdll.NtSetInformationVirtualMemory( |
| 19149 | windows.current_process, | 19151 | windows.current_process, |
| 19150 | .Prefetch, | 19152 | .Prefetch, |