]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Add always_inline to most allocator functions
authorJonathan Wakely <jwakely@redhat.com>
Fri, 16 Sep 2022 15:30:02 +0000 (16:30 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 8 Nov 2022 17:35:15 +0000 (17:35 +0000)
commit9d549401ae8ab334c8cba1c1339dbd3c8e695685
tree871bdaa17e2c143edf9f663aa2d3d450e5ac2aa0
parent3f1519eef5cbdcea2f18445852f5482798e3936a
libstdc++: Add always_inline to most allocator functions

This reduces the abstraction penalty for allocator support in
unoptimized code. Constructing and using allocators in containers calls
many one-line (or completely empty) inline functions. Those can all be
inlined to reduce code size and function call overhead for -O0.

libstdc++-v3/ChangeLog:

* include/bits/alloc_traits.h (allocator_traits): Add
always_inline attribute to all member functions.
(__do_alloc_on_copy, __alloc_on_copy, __do_alloc_on_move)
(__alloc_on_move, __do_alloc_on_swap, __alloc_on_swap)
(_Destroy(FwdIter, FwdIter, allocator<T>&)): : Add
always_inline attribute.
* include/bits/allocator.h (allocator): Add always_inline
attribute to all member functions and equality operators.
* include/bits/new_allocator.h (__new_allocator): Likewise.
* include/ext/alloc_traits.h (__gnu_cxx::__alloc_traits):
Likewise.
libstdc++-v3/include/bits/alloc_traits.h
libstdc++-v3/include/bits/allocator.h
libstdc++-v3/include/bits/new_allocator.h
libstdc++-v3/include/ext/alloc_traits.h