[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 04/30] timer: use an inline function for free
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 04/30] timer: use an inline function for free |
Date: |
Wed, 22 Feb 2017 12:33:54 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 21/02/2017 15:14, Marc-André Lureau wrote:
> Similarly to allocation, do it from an inline function. This allows
> tests to only use the headers for allocation/free of timer.
>
> Cc: Paolo Bonzini <address@hidden>
> Signed-off-by: Marc-André Lureau <address@hidden>
> Reviewed-by: Greg Kurz <address@hidden>
> ---
> include/qemu/timer.h | 5 ++++-
> 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/qemu-timer.c b/qemu-timer.c
> index ff620ecff7..6cf70b96f6 100644
> --- a/qemu-timer.c
> +++ b/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;
>
Reviewed-by: Paolo Bonzini <address@hidden>
- [Qemu-devel] [PATCH v2 00/30] Various memory leak fixes, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 01/30] qtest: fix a memory leak, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 02/30] tests: fix qmp response leak, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 04/30] timer: use an inline function for free, Marc-André Lureau, 2017/02/21
- Re: [Qemu-devel] [PATCH v2 04/30] timer: use an inline function for free,
Paolo Bonzini <=
- [Qemu-devel] [PATCH v2 03/30] tests: fix leaks in test-io-channel-command, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 05/30] glib-compat: add g_test_add_data_func_full fallback, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 06/30] tests: fix ptimer leaks, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 08/30] tests: fix q35-test leaks, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 07/30] tests: fix endianness-test leaks, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 09/30] tests: fix vhost-user-test leaks, Marc-André Lureau, 2017/02/21