[libcxx-commits] [PATCH] D112361: [libc++][format] Buffer changes proof-of-concept

Victor Zverovich via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 7 07:11:09 PST 2021


vitaut added inline comments.


================
Comment at: libcxx/include/__format/buffer.h:70
+
+  _LIBCPP_HIDE_FROM_ABI void push_back(_CharT __c) {
+    __ptr_[__size_++] = __c;
----------------
You might also want to provide an API for appending multiple chars at a time (e.g. a `string_view`) which can be implemented more efficiently than appending individual characters.


================
Comment at: libcxx/include/__format/buffer.h:80-81
+  _LIBCPP_HIDE_FROM_ABI void flush() {
+    __flush_(__ptr_, __size_, __obj_);
+    __size_ = 0;
   }
----------------
Wouldn't this overwrite the data for direct storage?


================
Comment at: libcxx/include/__format/buffer.h:97
+template <__formatter::__char_type _CharT>
+class _LIBCPP_TEMPLATE_VIS __interal_storage {
+public:
----------------
Did you mean `internal_storage`? (missing "n")


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112361/new/

https://reviews.llvm.org/D112361



More information about the libcxx-commits mailing list