forked from OSchip/llvm-project
555214cbcc
Instead of using a temporary `string` in `__vformat_to_wrapped` use a new generic iterator. This aids to reduce the number of template instantions and avoids using a `string` to buffer the entire formatted output. This changes the type of `format_context` and `wformat_context`, this can still be done since the code isn't ABI stable yet. Several approaches have been evaluated: - Using a __output_buffer base class with: - a put function to store the buffer in its internal buffer - a virtual flush function to copy the internal buffer to the output - Using a `function` to forward the output operation to the output buffer, much like the next method. - Using a type erased function point to store the data in the buffer. The last version resulted in the best performance. For some cases there's still a loss of speed over the original method. This loss many becomes apparent when large strings are copied to a pointer like iterator, before the compiler optimized this using `memcpy`. Reviewed By: ldionne, vitaut, #libc Differential Revision: https://reviews.llvm.org/D110495 |
||
---|---|---|
.. | ||
buffer.h | ||
format_arg.h | ||
format_args.h | ||
format_context.h | ||
format_error.h | ||
format_fwd.h | ||
format_parse_context.h | ||
format_string.h | ||
format_to_n_result.h | ||
formatter.h | ||
formatter_bool.h | ||
formatter_char.h | ||
formatter_floating_point.h | ||
formatter_integer.h | ||
formatter_integral.h | ||
formatter_pointer.h | ||
formatter_string.h | ||
parser_std_format_spec.h |