summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-01-27 16:11:06 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-01-27 16:11:59 (GMT)
commitf4893ac0b15b939859a599fca8fb0beca814ba93 (patch)
tree39cdd4cca0f2aa6a6744c2ed8f4cfa29c208ba9f /Source/cmGlobalNinjaGenerator.cxx
parentb41b841cc6370a548bf193711a9b37e24b509605 (diff)
parentbbdb000c55f82dc12f87a43f68defdfc246c6e51 (diff)
downloadCMake-f4893ac0b15b939859a599fca8fb0beca814ba93.zip
CMake-f4893ac0b15b939859a599fca8fb0beca814ba93.tar.gz
CMake-f4893ac0b15b939859a599fca8fb0beca814ba93.tar.bz2
Merge topic 'enlarge-build-file-stream-buffer'
bbdb000c55 GlobalNinjaGenerator: enlarge file stream buffer Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6903
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 982b6af..4245037 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -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"