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: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH] use qemu_malloc and friends consistently
Date: Fri, 29 May 2009 11:38:11 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

address@hidden schrieb:
> Thanks for pointing this. I guess it just sounds strange to me that somebody 
> would want to alloc 0 bytes. But why not ...

Yes, this is a corner case. Not useful, but currently allowed and
definitely shouldn't crash the process.

> I guess that if pattern_count/count is set to 0 we can just avoid the all 
> processing of malloc/memset/memcmp/free anyway.
> 
> Would you be ok with something like:
> 
> if (Pflag && pattern_count) {
> 
> instead of: 
> 
> if (Pflag) {

To be honest, the whole point of my mail was to provoke answers like
Anthony's and get qemu_malloc fixed. ;-)

But sure, the change you propose in qemu-io is fine and will make things
work even with current qemu_malloc.

Kevin




reply via email to

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