On 01/02/2012 11:59 AM, Paolo Bonzini wrote:
On 12/20/2011 05:51 PM, Anthony Liguori wrote:
hw/object.c | 469 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
hw/object.h | 427 +++++++++++++++++++++++++++++++++++++++++++++++++++
A couple more remarks:
1) Please put it outside hw/
Done :-)
2) Why do you need a list for the interface objects at all? You can make
obj->interfaces point to a single blob, and initialize the objects in place. You
only need to store the number of interfaces into the TypeImpl or in the object
header, or add a dummy Interface at the end whose contents are all-zero.
Interfaces aren't really handled in a special way. You could easily make it so
that the infrastructure could be modified to allow true multiple inheritance.
I'm not sure I see an obvious benefit to making interfaces handled more as a
special case. Right now, the only place that really even knows about interfaces
is dynamic_cast and initialization. That seems like a good thing to me.
Regards,
Anthony Liguori
Paolo