[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/28] timer: use an inline function for free
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PULL 04/28] timer: use an inline function for free |
Date: |
Wed, 1 Mar 2017 13:04:29 +0400 |
Similarly to allocation, do it from an inline function. This allows
tests to only use the headers for allocation/free of timer.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
---
include/qemu/timer.h | 5 ++++-
util/qemu-timer.c | 5 -----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index 9abed51ae8..26e628584c 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -610,7 +610,10 @@ void timer_deinit(QEMUTimer *ts);
*
* Free a timer (it must not be on the active list)
*/
-void timer_free(QEMUTimer *ts);
+static inline void timer_free(QEMUTimer *ts)
+{
+ g_free(ts);
+}
/**
* timer_del:
diff --git a/util/qemu-timer.c b/util/qemu-timer.c
index ff620ecff7..6cf70b96f6 100644
--- a/util/qemu-timer.c
+++ b/util/qemu-timer.c
@@ -355,11 +355,6 @@ void timer_deinit(QEMUTimer *ts)
ts->timer_list = NULL;
}
-void timer_free(QEMUTimer *ts)
-{
- g_free(ts);
-}
-
static void timer_del_locked(QEMUTimerList *timer_list, QEMUTimer *ts)
{
QEMUTimer **pt, *t;
--
2.12.0.rc2.3.gc93709801
- [Qemu-devel] [PULL 00/28] Leak patches, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 01/28] qtest: fix a memory leak, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 02/28] tests: fix qmp response leak, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 03/28] tests: fix leaks in test-io-channel-command, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 04/28] timer: use an inline function for free,
Marc-André Lureau <=
- [Qemu-devel] [PULL 05/28] glib-compat: add g_test_add_data_func_full fallback, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 06/28] tests: fix ptimer leaks, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 07/28] tests: fix endianness-test leaks, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 08/28] tests: fix q35-test leaks, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 09/28] tests: fix vhost-user-test leaks, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 10/28] tests: fix ide-test leaks, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 12/28] tests: fix bios-tables-test leak, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 11/28] tests: fix hd-geo-test leaks, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 13/28] tests: fix ipmi-kcs-test leak, Marc-André Lureau, 2017/03/01
- [Qemu-devel] [PULL 14/28] tests: fix ipmi-bt-test leak, Marc-André Lureau, 2017/03/01