On 10 May 2013 17:14, Andreas Färber <[email protected]> wrote: > Personally I wouldn't oppose dropping these checks for release builds as > proposed by Paolo in his series; for me, the value of POWERPC_CPU() is > being closer to an OO cast than any container_of()-style expressions. > > But I can also see Anthony's point that we should try to optimize > dynamic_cast rather than circumventing it.
I don't think we should be doing anything dynamically at all. We know at compile time that we've been passed a CPUPPCState*, and we know that we always get from that to a CPUState* by subtracting a compile-time-constant offset. Nothing about this is dynamic at all and anything we do at runtime beyond that subtraction is pure overhead. thanks -- PMM
