• Dean Moldovan's avatar
    Reduce binary size overhead of new-style constructors · 39fd6a94
    Dean Moldovan authored
    The lookup of the `self` type and value pointer are moved out of
    template code and into `dispatcher`. This brings down the binary
    size of constructors back to the level of the old placement-new
    approach. (It also avoids a second lookup for `init_instance`.)
    
    With this implementation, mixing old- and new-style constructors
    in the same overload set may result in some runtime overhead for
    temporary allocations/deallocations, but this should be fine as
    old style constructors are phased out.
    39fd6a94
test_factory_constructors.py 15.5 KB