[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends |
Date: |
Mon, 07 Dec 2009 10:45:39 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Ian Molton <address@hidden> writes:
> Markus Armbruster wrote:
>
>> p = malloc(n * sizeof(struct foo);
>> if (n && !p)
>> exit_no_mem();
>> for (i = 0; i < n; i++)
>> compute_one(p, i);
>>
>> With qemu_malloc(), the error handling moves into qemu_malloc():
>>
>> p = qemu_malloc(n * sizeof(struct foo);
>> for (i = 0; i < n; i++)
>> compute_one(p, i);
>
> And you lose the ability to fail gracefully...
That's a deliberate choice. It has its drawbacks, it has its
advantages. And it's not related to the question at hand: permitting
zero arguments.
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, (continued)
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, malc, 2009/12/06
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Avi Kivity, 2009/12/06
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, malc, 2009/12/06
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Avi Kivity, 2009/12/07
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Kevin Wolf, 2009/12/07
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Ian Molton, 2009/12/06
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Jamie Lokier, 2009/12/06
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Ian Molton, 2009/12/07
- [Qemu-devel] Re: [PATCH] Permit zero-sized qemu_malloc() & friends, Paolo Bonzini, 2009/12/07
- Re: [Qemu-devel] Re: [PATCH] Permit zero-sized qemu_malloc() & friends, Avi Kivity, 2009/12/07
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends,
Markus Armbruster <=
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Kevin Wolf, 2009/12/07
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Glauber Costa, 2009/12/07
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Blue Swirl, 2009/12/05
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Avi Kivity, 2009/12/05
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Laurent Desnogues, 2009/12/05
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Ian Molton, 2009/12/05
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Avi Kivity, 2009/12/05
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Ian Molton, 2009/12/05
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Avi Kivity, 2009/12/06
- Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends, Ian Molton, 2009/12/06