mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
Merge topic 'enlarge-build-file-stream-buffer'
bbdb000c55 GlobalNinjaGenerator: enlarge file stream buffer
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6903
This commit is contained in:
@@ -1025,6 +1025,19 @@ bool cmGlobalNinjaGenerator::OpenBuildFileStreams()
|
||||
return false;
|
||||
}
|
||||
|
||||
// New buffer size 8 MiB
|
||||
constexpr auto buildFileStreamBufferSize = 8 * 1024 * 1024;
|
||||
|
||||
// Ensure the buffer is allocated
|
||||
if (!this->BuildFileStreamBuffer) {
|
||||
this->BuildFileStreamBuffer =
|
||||
cm::make_unique<char[]>(buildFileStreamBufferSize);
|
||||
}
|
||||
|
||||
// Enlarge the internal buffer of the `BuildFileStream`
|
||||
this->BuildFileStream->rdbuf()->pubsetbuf(this->BuildFileStreamBuffer.get(),
|
||||
buildFileStreamBufferSize);
|
||||
|
||||
// Write a comment about this file.
|
||||
*this->BuildFileStream
|
||||
<< "# This file contains all the build statements describing the\n"
|
||||
|
||||
@@ -529,6 +529,7 @@ private:
|
||||
/// The file containing the build statement. (the relationship of the
|
||||
/// compilation DAG).
|
||||
std::unique_ptr<cmGeneratedFileStream> BuildFileStream;
|
||||
std::unique_ptr<char[]> BuildFileStreamBuffer;
|
||||
/// The file containing the rule statements. (The action attached to each
|
||||
/// edge of the compilation DAG).
|
||||
std::unique_ptr<cmGeneratedFileStream> RulesFileStream;
|
||||
|
||||
Reference in New Issue
Block a user