qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends


From: Ian Molton
Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends
Date: Sun, 06 Dec 2009 16:58:37 +0000
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)

Avi Kivity wrote:
> On 12/06/2009 01:25 AM, Ian Molton wrote:
>> Avi Kivity wrote:
>>
>>   
>>> It's not that it doesn't have a way to report failure, it's that it
>>> doesn't fail.  Do you prefer functions that fail and report it to
>>> functions that don't fail?
>>>      
>> You have a way of allocating memory that will _never_ fail?
>
> Sort of. 

'sort of' never ?

> Did you look at the code?

Yes. Its hardly infallible.

>> well, make sure n is not 0. Its not that hard. I dont think I've *ever*
>> had a situation where I wanted to pass 0 to malloc.
> 
> There are multiple such cases in the code.
> 
>>>> stick to what people know, and LART them for misuse of it if necessary.
>>>>        
>>> The LART is a crash, great.
>>>      
>> No, the LART would be a 'your patch does this wrong, try this:'
> 
> What about existing usage?  Will you audit all the existing calls?

mark qemu_malloc as deprecated. don't include new patches that use it.
Plenty of time to fix the broken uses...

-Ian






reply via email to

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