Il 28/03/2014 15:52, Andreas Färber ha scritto:
I do wonder if it wouldn't make more sense to simply
#define CPU(obj) ((CPUState *)obj)
which would catch all uses of CPU() while still allowing to change it to
#define CPU(obj) dynamic_cast(obj)
or so in the future without touching dozens of places
Am 26.03.2014 14:42, schrieb Paolo Bonzini:
> QOM casts are only typesafe inasmuch as we know that the argument is
> a QOM object. If it is not, the accesses to fields in Object can
> access invalid memory and thus cause a segfault.
>
> Using a QOM cast in ENV_GET_CPU is useless and harmful. Use
> (average of 5 runs):
> - before: 17.8s
> - with your patch: 17s
What about 1.7?
Paolo
On Wed, Mar 26, 2014 at 2:42 PM, Paolo Bonzini wrote:
> QOM casts are only typesafe inasmuch as we know that the argument is
> a QOM object. If it is not, the accesses to fields in Object can
> access invalid memory and thus cause a segfault.
>
> Using a QOM cast in ENV_GET_CPU is useless and har
On Wed, Mar 26, 2014 at 2:55 PM, Paolo Bonzini wrote:
> Il 26/03/2014 14:42, Paolo Bonzini ha scritto:
>
>> QOM casts are only typesafe inasmuch as we know that the argument is
>> a QOM object. If it is not, the accesses to fields in Object can
>> access invalid memory and thus cause a segfault.
Il 26/03/2014 14:42, Paolo Bonzini ha scritto:
QOM casts are only typesafe inasmuch as we know that the argument is
a QOM object. If it is not, the accesses to fields in Object can
access invalid memory and thus cause a segfault.
Using a QOM cast in ENV_GET_CPU is useless and harmful. Useless,
QOM casts are only typesafe inasmuch as we know that the argument is
a QOM object. If it is not, the accesses to fields in Object can
access invalid memory and thus cause a segfault.
Using a QOM cast in ENV_GET_CPU is useless and harmful. Useless,
because the cast is applied to the result of con