Re: Linux kernel modules development in C++

From: Timur Tabi (ttabi@interactivesi.com)
Date: Thu Sep 28 2000 - 17:02:51 EST


** Reply to message from Horst von Brand <vonbrand@inf.utfsm.cl> on Thu, 28 Sep
2000 16:44:55 -0400

> Right. And C++ was designed carefully along "you pay for what you use", so
> with careful programming it should be no worse. OTOH, in C you _see_ the
> costs [OK, maybe a hardened asm-fanatic will take issue with that...], in
> C++ you don't necessarily see what is going on.

I don't agree with that at all. C is not better or worse than C++ in this
regard. The only way to truly know what you get is to examine the generated
assembly code. When I do this, more often than not I'm surprised at how the
compiler interpreted my code, or what code the compiler generated. The only
time my C++ compiler generated code that I was wildly less efficient than I
expected was when I created an lookup table of member functions. I had to
rewrite the code to use a switch/case statement instead.

-- 
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com

When replying to a mailing-list message, please don't cc: me, because then I'll just get two copies of the same message. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 30 2000 - 21:00:23 EST