qemu-devel@nongnu.org
[Top] [All Lists]

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

Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends
From: Paul Brook
Date: Tue, 1 Dec 2009 12:57:27 +0000
> You might want to have a 'static uint8_t zero_length_malloc[0]' and
> return that instead of the magic cookie '1'.  Makes the code more
> readable IMHO and you'll also have symbol in gdb when debugging qemu.

Having multiple malloc return the same pointer sounds like a really bad idea.

Paul


<Prev in Thread] Current Thread [Next in Thread>