[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 25/73] queue: add QTAILQ_REMOVE_SEVERAL
From: |
Alex Bennée |
Subject: |
[PULL v2 25/73] queue: add QTAILQ_REMOVE_SEVERAL |
Date: |
Fri, 25 Oct 2019 07:36:25 +0100 |
From: "Emilio G. Cota" <address@hidden>
This is faster than removing elements one by one.
Will gain a user soon.
Signed-off-by: Emilio G. Cota <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
diff --git a/include/qemu/queue.h b/include/qemu/queue.h
index 73bf4a984d8..4764d93ea3f 100644
--- a/include/qemu/queue.h
+++ b/include/qemu/queue.h
@@ -420,6 +420,16 @@ union {
\
(elm)->field.tqe_circ.tql_prev = NULL; \
} while (/*CONSTCOND*/0)
+/* remove @left, @right and all elements in between from @head */
+#define QTAILQ_REMOVE_SEVERAL(head, left, right, field) do { \
+ if (((right)->field.tqe_next) != NULL) \
+ (right)->field.tqe_next->field.tqe_circ.tql_prev = \
+ (left)->field.tqe_circ.tql_prev; \
+ else \
+ (head)->tqh_circ.tql_prev = (left)->field.tqe_circ.tql_prev; \
+ (left)->field.tqe_circ.tql_prev->tql_next = (right)->field.tqe_next; \
+ } while (/*CONSTCOND*/0)
+
#define QTAILQ_FOREACH(var, head, field) \
for ((var) = ((head)->tqh_first); \
(var); \
--
2.20.1
- [PULL v2 18/73] trace: add mmu_index to mem_info, (continued)
- [PULL v2 18/73] trace: add mmu_index to mem_info, Alex Bennée, 2019/10/25
- [PULL v2 20/73] translate-all: use cpu_in_exclusive_work_context() in tb_flush, Alex Bennée, 2019/10/25
- [PULL v2 30/73] atomic_template: add inline trace/plugin helpers, Alex Bennée, 2019/10/25
- [PULL v2 62/73] tests/tcg: move "virtual" tests to EXTRA_TESTS, Alex Bennée, 2019/10/25
- [PULL v2 49/73] target/xtensa: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 60/73] tests/tcg/Makefile.target: fix path to config-host.mak, Alex Bennée, 2019/10/25
- [PULL v2 50/73] target/openrisc: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 57/73] vl: support -plugin option, Alex Bennée, 2019/10/25
- [PULL v2 69/73] include/exec: wrap cpu_ldst.h in CONFIG_TCG, Alex Bennée, 2019/10/25
- [PULL v2 17/73] trace: expand mem_info:size_shift to 4 bits, Alex Bennée, 2019/10/25
- [PULL v2 25/73] queue: add QTAILQ_REMOVE_SEVERAL,
Alex Bennée <=
- [PULL v2 15/73] tests/docker: set HOST_ARCH if we don't have ARCH, Alex Bennée, 2019/10/25
- [PULL v2 46/73] target/alpha: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 35/73] *-user: plugin syscalls, Alex Bennée, 2019/10/25
- [PULL v2 67/73] tests/plugin: add hotpages to analyse memory access patterns, Alex Bennée, 2019/10/25
- [PULL v2 34/73] *-user: notify plugin of exit, Alex Bennée, 2019/10/25
- [PULL v2 45/73] target/m68k: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 48/73] target/sparc: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 32/73] plugins: implement helpers for resolving hwaddr, Alex Bennée, 2019/10/25
- [PULL v2 41/73] target/ppc: fetch code with translator_ld, Alex Bennée, 2019/10/25