aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorMatthieu Longo <matthieu.longo@arm.com>2026-01-30 15:08:41 +0000
committerMatthieu Longo <matthieu.longo@arm.com>2026-02-05 15:35:03 +0000
commit7722c043f05deb75b4b5ab92740d0d491101f5c2 (patch)
tree82281c340c730acdafb15ad1dbdff080626add85 /libstdc++-v3
parent86efa55197ed1e8dde32219fddca352e915da24d (diff)
downloadgcc-trunk.zip
gcc-trunk.tar.gz
gcc-trunk.tar.bz2
libiberty: add helper to swap doubly-linked list wrappersHEADtrunkmaster
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