[all-commits] [llvm/llvm-project] 889302: [libc++][format][3/6] Adds a __container_buffer.

mordante via All-commits all-commits at lists.llvm.org
Sat Apr 9 00:36:00 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 889302292bf6607a6606a771bb2bf0ce919e80bc
      https://github.com/llvm/llvm-project/commit/889302292bf6607a6606a771bb2bf0ce919e80bc
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2022-04-09 (Sat, 09 Apr 2022)

  Changed paths:
    M libcxx/include/CMakeLists.txt
    M libcxx/include/__format/buffer.h
    A libcxx/include/__format/enable_insertable.h
    M libcxx/include/deque
    M libcxx/include/format
    M libcxx/include/list
    M libcxx/include/module.modulemap
    M libcxx/include/string
    M libcxx/include/vector
    M libcxx/test/libcxx/private_headers.verify.cpp
    A libcxx/test/libcxx/utilities/format/enable_insertable.compile.pass.cpp

  Log Message:
  -----------
  [libc++][format][3/6] Adds a __container_buffer.

Instead of writing every character directly into the container by using
a `back_insert_iterator` the data is buffered in an `array`. This buffer
is then inserted to the container by calling its `insert` member function.

Since there's no guarantee every container's `insert` behaves properly
containers need to opt-in to this behaviour. The appropriate standard
containers opt-in to this behaviour.

This change improves the performance of the format functions that use a
`back_insert_iterator`.

Depends on D110495

Reviewed By: ldionne, vitaut, #libc

Differential Revision: https://reviews.llvm.org/D110497




More information about the All-commits mailing list