-The second scenario is when the the Windows loader injects a DLL into the process at startup. That injected DLL can allocate memory which conflicts with where the PCH must reside. For example, `msbuild.exe` will inject `FileTracker.dll` into every `CL.exe` process at startup. In this scenario, using the [`/Fp` (Name .pch file)](../../build/reference/fp-name-dot-pch-file.md) flag will ensure that the memory for the PCH is allocated as early as possible in the `CL.exe` process, before any injected DLL. These failures can be intermittent because Windows ASLR will allocate memory at different address across different process invocations. Without `/Fp`, memory for the PCH cannot be allocated until the compiler has compiled enough of the program to see the header file specified in the `/Yu` command line option or the `#pragma hdrstop`. By this time, it is much more likely that the memory required by the PCH will already be reserved.
0 commit comments