[libcxx-commits] [libcxx] [libc++][format] Don't leave the output buffer full after a bulk write (PR #226791)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 28 01:20:37 PDT 2026


================
@@ -250,6 +250,10 @@ class __output_buffer {
       __first += __chunk;
       __n -= __chunk;
     } while (__n);
+
+    // push_back needs a free code unit, which the last chunk may have used.
----------------
frederick-vs-ja wrote:

To me, it was `push_back` that did a suspicious thing (https://github.com/llvm/llvm-project/issues/154670#issuecomment-3342606881). IIUC we need to add these `__prepare_write` calls if we want to keep the original optimization.

https://github.com/llvm/llvm-project/pull/226791


More information about the libcxx-commits mailing list