Re: [Wireshark-dev] using C++, was: Notes from Sharkfest '13

2013-06-25 Thread Evan Huus
On Tue, Jun 25, 2013 at 12:13 PM, Jeff Morriss wrote: > On 06/21/13 02:08, Dirk Jagdmann wrote: >>> >>> C++. It snuck in with Qt. Should we allow C++ in the rest of the code or >>> at least use C++ compilation everywhere? >> >> Another advantage would be that we can use real C++ exceptions. > > >

Re: [Wireshark-dev] using C++, was: Notes from Sharkfest '13

2013-06-25 Thread Jeff Morriss
On 06/21/13 02:08, Dirk Jagdmann wrote: C++. It snuck in with Qt. Should we allow C++ in the rest of the code or at least use C++ compilation everywhere? Another advantage would be that we can use real C++ exceptions. What would be the advantage of using C++ exceptions? (I sort of like the fa

Re: [Wireshark-dev] using C++, was: Notes from Sharkfest '13

2013-06-22 Thread Evan Huus
The problem really boils down to how objects are destroyed. In C, you simply call free(). In C++, you have to: - check if there are any complete class instances contained in your class, and recursively destroy them - check the vtable and call the appropriate destructor functions (more than one wh

Re: [Wireshark-dev] using C++, was: Notes from Sharkfest '13

2013-06-21 Thread ronnie sahlberg
Technically you could use smart pointers, or other types too. But beware the performance impact, and do get numbers before changing. Ethereal/Wireshark does an enormous amount of small allocations and frees. One of my primary goals when we added the first emem allocators were performance. Make

[Wireshark-dev] using C++, was: Notes from Sharkfest '13

2013-06-21 Thread Dirk Jagdmann
> C++. It snuck in with Qt. Should we allow C++ in the rest of the code or > at least use C++ compilation everywhere? A tough call. If we go C++ we should have a plan to use the STL classes with our concept of memory (allocator scope). I've started a short discussion last year, but somebody found