[Top][All Lists]

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

Re: [PATCH] Make qemu_alloc()/qemu_realloc() return NULL for size==0 (wa

From: Kevin Wolf
Subject: Re: [PATCH] Make qemu_alloc()/qemu_realloc() return NULL for size==0 (was Re: [Qemu-devel] [PATCH] fix qemu_malloc() error check for size==0)
Date: Wed, 20 May 2009 10:00:57 +0200
User-agent: Thunderbird (X11/20090320)

malc schrieb:
> Thanks for an attempt, but i don't like it either, since it sortof
> breaks the (unspoken?) qemu_malloc/realloc contract that those will
> never return NULL. I've commited the thing i had in mind.

I don't know of such a contract. If you want to have it, you should add
a comment which specifies what is guaranteed and what not. And best post
the patch to the list first this time.

Btw, even with your patch realloc(ptr, 0) with ptr != NULL still can
return NULL. And if you now go ahead and forbid size = 0 entirely, I'm
almost sure we have a regression as I didn't do the original patch to
allow this just for fun but because it's used...


reply via email to

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