On 07/12/18 13:32, Thomas Huth wrote:
> On 2018-12-03 16:32, Paolo Bonzini wrote:
>> qgraph will embed these objects instead of allocating them in a separate
>> object.  Expose a new API "generic_alloc_init" and "generic_alloc_destroy"
>> for that, and rename the existing API with s/init/new/ and s/uninit/free/.
> 
> Could you please add a sentence *why* you are doing this? ... without
> that information, this just looks like a lot of unnecessary code churn...

The explanation is simply that if you allocate them separately you have
to define a destructor function to free it---more boilerplate and more
stuff that you can get wrong.  Therefore qgraph tries to use embedded
structs when something is always there (a "contains" edge).

The same is true for 16/71, you want to use heap-allocated PCI buses for
non-qgraph tests, but for a qgraph machine it would be very much
preferrable to embed it in the PCI host bridge QOSGraphObject.

Paolo

Reply via email to