[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_updates to avoid memory leak


  • To: Stephan Creutz <stephan.creutz@xxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxxxxxxxx>
  • Date: Sun, 08 Apr 2007 08:53:09 +0100
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Sun, 08 Apr 2007 00:50:46 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acd5svLrMcIHPOWmEduv7QAWy6hiGQ==
  • Thread-topic: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_updates to avoid memory leak

On 7/4/07 15:03, "Stephan Creutz" <stephan.creutz@xxxxxxxxxxxxxxxxx> wrote:

>> The only user of this interface calls free() on that memory itself. It
>> also calls finish_mmu_update() more than once on the same mmu
>> structure, so freeing it in finish_mmu_update() would not work.
>> Probably best we rename xc_init_mmu_updates() to
>> xc_alloc_mmu_updates(), finish_mmu_update to flush_mmu_updates(), and
>> document the need for explicit free() in the header file. I'll do
>> this.
> 
> Oops, overlooked that, but xc_finish_mmu_updates sounded like a
> destructor. The new function names you propose and the comment should
> clear things up. But I would disagree to make the whole interface
> private (read that in the staging changelog) because otherwise I will
> have to duplicate the code for a program I'm working on (see my post
> recently before). On the other hand it would be a minimal effort to
> recode that for my needs.

What do you need it for? It's not all that useful to the toolstack any more.

 -- Keir


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.