1 Microsoft provides pageheap, a tool for detecting cross-border access by pointers.
2. Memory ing File
One of the hard-to-find problems is that the kernel object of the memory ing file created based on the system paging file is marked by passing in the hfile as the invalid_handle_value parameter, the returned value when a common hard disk file fails to be created or opened is invalid_handle_value.
......
Handle hfile = createfile (....);
Handle hmap = createfilemapping (hfile ,....);
......
This sectionCodeThe intention is to first create or open a common hard disk file, and then create a memory ing file kernel object based on this. However, if the first step fails to be created, an object based on the system paging file is generated.
Therefore, you must check the return value after calling createfile.
>>>>>>
ProgramStart optimization,Source code:
1. Reduce the number of configuration files started to read
In a system with a CPU of 2.6 GHz and a hard disk of 5400r/s, it takes about 40 ms to enable a stable operation. If the application contains 25 configuration files, it takes at least one second to open.
2. Pre-read files frequently accessed
You can compile a mapandreadthroughfile function using the memory ing file method in windows.