qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] use qemu_malloc and friends consistently


From: jcd
Subject: Re: [Qemu-devel] [PATCH] use qemu_malloc and friends consistently
Date: Fri, 29 May 2009 16:15:06 +0100 (GMT+01:00)

----- "malc" <address@hidden> a écrit :

> On Fri, 29 May 2009, Anthony Liguori wrote:
> 
> > 
> > I disagree.  The wrong reason we introduced oom_check() was because
> we
> > don't trust people to check returns.  Why would we trust them to
> check
> > size arguments especially when a lot of programmers are not going
> to
> > check size arguments by convention?
> > 
> > If we really want to fix up code, we can do so in a more benign way.
> 
> > Instead of aborting, let's return malloc(1) and printf a warning. 
> Then
> > we can fix sites without worrying about killing guests.
> 
> Printf a warning saying what exactly?

I guess it should say malloc(0) was used with a backtrace to be usefull ...

> > If we only have to fixup a few sites, then yeah, we can switch to
> > abort().  If it turns out there's a ton of these things and the code
> is
> > uglier, then we can give up and just accept these semantics.
> 
> We _already_ use abort, and so far only one caller was caught and
> taken care of.

I am going to throw in a few more potential cases with my proposed patch. But 
not that many ...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]