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: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH] use qemu_malloc and friends consistently
Date: Mon, 1 Jun 2009 12:59:57 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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

Something that nobody pointed out is that sometimes you can have
zero-length structures these days.  E.g. if you have a struct
containing a few spinlocks in the Linux kernel, it will be zero length
when built on UP targets.  I doubt if QEMU has any such structures,
but it's the sort of thing that shouldn't break
qemu_malloc(sizeof(some_type)).

-- Jamie




reply via email to

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