Reduce RAM usage: Avoid keeping a copy of the preprocessed source files content during checking.

This commit is contained in:
PKEuS 2014-10-02 19:40:41 +02:00
parent 5a4526e997
commit 542cb1cd8e
1 changed files with 4 additions and 4 deletions

View File

@ -225,17 +225,17 @@ unsigned int CppCheck::processFile(const std::string& filename, const std::strin
}
Timer t("Preprocessor::getcode", _settings._showtime, &S_timerResults);
const std::string codeWithoutCfg = preprocessor.getcode(filedata, cfg, filename);
std::string codeWithoutCfg = preprocessor.getcode(filedata, cfg, filename);
t.Stop();
const std::string &appendCode = _settings.append();
codeWithoutCfg += _settings.append();
if (_settings.debugFalsePositive) {
if (findError(codeWithoutCfg + appendCode, filename.c_str())) {
if (findError(codeWithoutCfg, filename.c_str())) {
return exitcode;
}
} else {
if (!checkFile(codeWithoutCfg + appendCode, filename.c_str(), checksums)) {
if (!checkFile(codeWithoutCfg, filename.c_str(), checksums)) {
if (_settings.isEnabled("information") && (_settings.debug || _settings._verbose))
purgedConfigurationMessage(filename, cfg);
}