diff options
| author | Matthieu Longo <matthieu.longo@arm.com> | 2026-01-30 15:08:41 +0000 |
|---|---|---|
| committer | Matthieu Longo <matthieu.longo@arm.com> | 2026-02-05 15:35:03 +0000 |
| commit | 7722c043f05deb75b4b5ab92740d0d491101f5c2 (patch) | |
| tree | 82281c340c730acdafb15ad1dbdff080626add85 /libstdc++-v3 | |
| parent | 86efa55197ed1e8dde32219fddca352e915da24d (diff) | |
| download | gcc-trunk.zip gcc-trunk.tar.gz gcc-trunk.tar.bz2 | |
This patch introduces a new helper to swap the contents of two
doubly-linked list wrappers. The new *_swap_lists operation exchanges
the first, last, and size fields, allowing two lists to be swapped
efficiently without iterating over their elements.
This helper is intended for cases where the ownership of a list must be
exchanged but swapping wrapper pointers is not possible. For simple
references to lists, when wrappers are dynamically allocated, swapping
the wrapper pointers themselves is sufficient and remains the preferred
approach.
This change adds the necessary declaration and definition macros to
doubly-linked-list.h and integrates them into the set of mutative
list operations.
The testsuite is updated accordingly to cover the new functionality.
include/ChangeLog:
* doubly-linked-list.h
(LINKED_LIST_SWAP_LISTS): Add new helper.
(LINKED_LIST_DECL_SWAP_LISTS): Likewise.
(LINKED_LIST_DEFN_SWAP_LISTS): Likewise.
(LWRAPPERTYPE##_swap_lists): Likewise.
libiberty/ChangeLog:
* testsuite/test-doubly-linked-list.c: Update.
Diffstat (limited to 'libstdc++-v3')
0 files changed, 0 insertions, 0 deletions
