Hi,

Greg Ewing wrote:
> Stefan Behnel wrote:
> 
>> Dag Sverre Seljebotn wrote:
>>
>>> I.e. on vtable generation it seems to skip its immediate ancestor.
>> It still seems to be the right thing to do. Maybe Greg can enlighten us here.
> 
> There are a couple of things going on:
> 
> * When one type inherits from another, the struct for the
> ancestor type is embedded as a member at the beginning of
> the derived type, named __pyx_base.
> 
> * There is at most one vtable pointer in each instance,
> and it lives in the struct for the most ancestral type
> that has any C methods.

Sounds good to me.


> So the chain of __pyx_base references is drilling down
> through the layers of the onion to the struct where the
> vtable pointer is declared.

Ok, then the patch is actually correct in that it also drills down to the
ancestor type that defines the vtable and casts the pointer to that type.

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to