From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Campbell <ian.campbell@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>, Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [PATCH] tools/libxl: Correct use of phyinfo_{init, dispose}()
Date: Wed, 5 Aug 2015 09:52:15 +0100 [thread overview]
Message-ID: <55C1CEBF.5080707@citrix.com> (raw)
In-Reply-To: <1438764034.9747.16.camel@citrix.com>
On 05/08/15 09:40, Ian Campbell wrote:
> On Tue, 2015-08-04 at 19:58 +0100, Andrew Cooper wrote:
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Ian Campbell <Ian.Campbell@citrix.com>
>> CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
>> CC: Wei Liu <wei.liu2@citrix.com>
>>
>> For my cpuid work which I have just started, I added an array to physinfo.
>> Coverity then frowned at me when it spotted all the memory leaks.
>>
>> Technically speaking, 4.6 isn't broken due to not having an allocation to free
>> in _dispose(), but this patch might still be worth taking in 4.6.
> We've tended to be rather lax about this for internal code when there is no
> actual work in the init/dispose functions in the current code base, so
> while this improvement is the sort of thing we should/would routinely
> except during development window I personally don't think it is worth a
> freeze exception.
Ok.
>
> @@ -4653,6 +4654,8 @@ static int libxl__fill_dom0_memory_info(libxl__gc
>> *gc, uint32_t *target_memkb,
>> if (rc < 0)
>> goto out;
>>
>> + libxl_physinfo_dispose(&physinfo);
>> + libxl_physinfo_init(&physinfo);
> This pattern is starting to crop up a lot in loops of this type. I wonder
> if I should make the idl generate a libxl_FOO_reinit() which just ==
> dispose+init?
Probably a good idea. I believe I introduced the first use of that
style, finding nothing better as an alternative.
~Andrew
prev parent reply other threads:[~2015-08-05 8:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 18:58 [PATCH] tools/libxl: Correct use of phyinfo_{init, dispose}() Andrew Cooper
2015-08-04 21:25 ` Wei Liu
2015-08-04 21:27 ` Andrew Cooper
2015-08-05 8:40 ` Ian Campbell
2015-08-05 8:52 ` Andrew Cooper [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55C1CEBF.5080707@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.