[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 04/12] util/range: add range_list_free()
From: |
Sven Schnelle |
Subject: |
[PATCH v3 04/12] util/range: add range_list_free() |
Date: |
Fri, 1 Mar 2024 18:46:01 +0100 |
Introduce range_list_free(), which takes a GList of ranges
and frees the list and each range.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
include/qemu/range.h | 5 +++++
util/range.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/include/qemu/range.h b/include/qemu/range.h
index 530b0c7db1..4ff9799d89 100644
--- a/include/qemu/range.h
+++ b/include/qemu/range.h
@@ -240,4 +240,9 @@ void range_inverse_array(GList *in_ranges,
void range_list_from_string(GList **out_ranges, const char *filter_spec,
Error **errp);
+/*
+ * Free a list of ranges.
+ */
+void range_list_free(GList *ranges);
+
#endif
diff --git a/util/range.c b/util/range.c
index bd2d0961bd..7234ab7a53 100644
--- a/util/range.c
+++ b/util/range.c
@@ -197,3 +197,8 @@ out:
g_free(range);
g_strfreev(ranges);
}
+
+void range_list_free(GList *ranges)
+{
+ g_list_free_full(ranges, g_free);
+}
--
2.43.2
- Re: [PATCH v3 01/12] util/log: convert debug_regions to GList, (continued)
[PATCH v3 06/12] util/range: split up range_list_from_string(), Sven Schnelle, 2024/03/01
[PATCH v3 05/12] util/range: use append_new_range() in range_list_from_string(), Sven Schnelle, 2024/03/01
[PATCH v3 02/12] util/log: make qemu_set_dfilter_ranges() take a GList, Sven Schnelle, 2024/03/01
[PATCH v3 03/12] util/range: move range_list_from_string() to range.c, Sven Schnelle, 2024/03/01
[PATCH v3 07/12] util/range: make range_list_from_string() accept a single number, Sven Schnelle, 2024/03/01
[PATCH v3 08/12] qemu/range: add range_list_contains() function, Sven Schnelle, 2024/03/01
[PATCH v3 04/12] util/range: add range_list_free(),
Sven Schnelle <=
[PATCH v3 10/12] plugins: add range list API, Sven Schnelle, 2024/03/01
[PATCH v3 12/12] plugins/execlog: add data address match, Sven Schnelle, 2024/03/01
[PATCH v3 09/12] plugins: add API to print errors, Sven Schnelle, 2024/03/01
[PATCH v3 11/12] plugins/execlog: use range list api, Sven Schnelle, 2024/03/01