diff options
author | Clemens Wasser <clemens.wasser@gmail.com> | 2022-01-25 20:27:27 (GMT) |
---|---|---|
committer | Clemens Wasser <clemens.wasser@gmail.com> | 2022-01-26 16:09:21 (GMT) |
commit | bbdb000c55f82dc12f87a43f68defdfc246c6e51 (patch) | |
tree | 3b63fe5688b7a544d3ac55ead5c2ab257432abd7 /Source/cmGlobalNinjaGenerator.cxx | |
parent | 850bdc4203f4599fceaed2ae9ba21c53e71fd0fb (diff) | |
download | CMake-bbdb000c55f82dc12f87a43f68defdfc246c6e51.zip CMake-bbdb000c55f82dc12f87a43f68defdfc246c6e51.tar.gz CMake-bbdb000c55f82dc12f87a43f68defdfc246c6e51.tar.bz2 |
GlobalNinjaGenerator: enlarge file stream buffer
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 19c4ee3..614cb66 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1021,6 +1021,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" |