lkml.org 
[lkml]   [2000]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Criticism] On the discussion about C++ modules

On Mon, 16 Oct 2000 02:06:05 Jeff V. Merkey wrote:
>
>
> The [new] and constructor/destructor operations create hidden memory
> allocations in C++ that can blow performance in kernel "fast paths".
> Writing kernel code in C++ is never a good idea because of this problem,

I agree that C++ for kernel is not a good idea, libstdc++ should be in the
kernel,
code would be bigger, there's a complicated runtime under C++ doing things
by itself (copy constructors-operators and so on), inheritance adds some
little calling overhead.

But there are some features of C++ that would be of great value for kernel
development (in general for imperative programming), for example:
- <const &> args : dont break your untouchable data, and get rid of pointer mess
- for (int i=0; ...) : don't use index outside loop
And simple member functions are also fine, they impose NO call overhead
and simplify the use of structs (hey, you can define structs with member
funcs in C++, they dont have to be classes).

So the base C++ is fine, its organized C. Esoteric features make the
difference. This remembers me a thing a saw one time in a Degree project
at the University department I work: there's a thing called
EmbeddedC++, that is just that: C++ whitout the toys, just the basic, designed
to
write code for cellular phones and so on (the project was for a
company in spain to develop the GUI for its mobile phones).

Perhaps a g++-embedded mode could be the solution...

--
Juan Antonio Magallon Lacarta mailto:jamagallon@able.es

-
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/

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.197 / U:0.632 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site