[Top][All Lists]

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

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

From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] use qemu_malloc and friends consistently
Date: Fri, 29 May 2009 04:05:55 -0500
User-agent: Thunderbird (X11/20090409)

Kevin Wolf wrote:
> Since recently qemu_malloc behaves differently from malloc with size =
> 0. This isn't allowed any more with qemu_malloc. So you need to check
> for pattern_count == 0 and either print an error message or malloc a
> different size, e.g. 1. I'm sure we don't want qemu-io to abort() in
> such a case.
> Or we could start over with a lengthy discussion about fixing qemu_malloc...

Having qemu_malloc(0) abort is silly.  Returning NULL or returning
malloc(1) are both reasonable options.

Putting the abort() in there is going to introduce a ton of subtle bugs,
I vote for changing qemu_malloc() to have a sane behavior.


Anthony Liguori

> Kevin

reply via email to

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