When loading a file via `FileManager::loadFileData`, a fixed-length buffer
is filled via `fread`. Then, in some cases, a conversion is done with the help
of `Utf8_16_Read`. However, the method `Utf8_16_Read::convert` performs a call
to `strlen` on this buffer. This is obviously wrong: `\0` char should be
accepted (even if a bit strange) and the buffer is not zero-terminated.
The changes merely consist in adding an additional parameter `length` to
not have to guess the size of the buffer.
The non-default constructor of the class Buffer calls the inner method
`checkFileState()`, using the private variable `_currentStatus` to determine
whether some checks on the file attached to the buffer are required or not.
However this variable is properly initialized _after_.
The session snapshot feature runs in its own thread and access to
Scintilla etc is not thread-safe. As a *temporary* and *non-exhaustive*
fix we guard some long-running operations (undo, redo, replace, sort)
with a mutex to prevent data corruption.
Project now utilizes the /MP compiler switch to perform
parallelized builds. The number of parallel builds performed
is determined on a per-machine basis based on available
logical CPUs.
Long term this will provide the best performance output to
code maintainability ratio compared to just enabling
precompiled headers.
Using my personal machine (8 cores), I got the following
timings (Debug configuration):
* Normal build : 89 seconds
* Multi-processor build : 28 seconds
* PCH enabled : 27 seconds
Note that the multi-processor build timings can be further
reduced with proper dependency management and removal of
existing precompiled header file (precompiledHeaders.h).
Specific Changes:
* Precompiled header support disabled (not compatible with
/MP flag).
* precompiledHeader.cpp deleted.
* Solution File added.
* Minimal Rebuild (/Gm) disabled (ignored when /MP is on).
precompiledHeaders.h still exists because it contains a ton of
inclusions required by lots of files. A second and less trivial
cleanup will involve removing the precompiledHeaders.h file and
individually correcting and satisfying dependencies in each source
file in the code base.