Re: Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Jonathan Wakely
On 22 October 2014 17:16, Martin Liška wrote: > On 10/22/2014 05:30 PM, Jonathan Wakely wrote: >> >> On 22 October 2014 16:15, Martin Liška wrote: >>> >>> Hello. >>> >>> I've been playing with following example: >>> >>> #include >>> >>> class Base >>> { >>> public: >>>virtual ~Base() {} >>> }

Re: Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Martin Liška
On 10/22/2014 05:30 PM, Jonathan Wakely wrote: On 22 October 2014 16:15, Martin Liška wrote: Hello. I've been playing with following example: #include class Base { public: virtual ~Base() {} }; class Derived: public Base { }; #define N 1000 int main() { Base **b = (Base **)malloc (s

Re: Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Martin Liška
On 10/22/2014 05:30 PM, Markus Trippelsdorf wrote: On 2014.10.22 at 17:15 +0200, Martin Liška wrote: Hello. I've been playing with following example: #include class Base { public: virtual ~Base() {} }; class Derived: public Base { }; #define N 1000 int main() { Base **b = (Base **

Re: Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Markus Trippelsdorf
On 2014.10.22 at 17:15 +0200, Martin Liška wrote: > Hello. > > I've been playing with following example: > > #include > > class Base > { > public: >virtual ~Base() {} > }; > > class Derived: public Base > { > }; > > #define N 1000 > > int main() > { >Base **b = (Base **)malloc (sizeo

Re: Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Jonathan Wakely
On 22 October 2014 16:15, Martin Liška wrote: > Hello. > > I've been playing with following example: > > #include > > class Base > { > public: > virtual ~Base() {} > }; > > class Derived: public Base > { > }; > > #define N 1000 > > int main() > { > Base **b = (Base **)malloc (sizeof(Base *) *

Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Martin Liška
Hello. I've been playing with following example: #include class Base { public: virtual ~Base() {} }; class Derived: public Base { }; #define N 1000 int main() { Base **b = (Base **)malloc (sizeof(Base *) * N); for (unsigned i = 0; i < N; i++) b[i] = new Derived(); for (unsigned