RE: [Criticism] On the discussion about C++ modules

From: J . A . Magallon (jamagallon@able.es)
Date: Mon Oct 16 2000 - 04:05:53 EST


Firs of all, as someone said, is there any other list where we can discuss this
?
It is ver off-topic here...

I messed in the discussion because I'm tired of seein people say that they don't
use
C++ because their big overheads, being slow, messed, out of programmer's control
for
low level tasks and so on. They seem to not have read anything about compilers
or
the design of C++. One of the premises of C++ was tat ANYTHING that could be
done in
C was not slower or used more resources for being done with a c++ feature.

In the kernel you say in C:

generic_driver_init(&my_driver,ñparams);
my_driver->specific_init(&my_driver,params);

and in C++
my_driver.init(params), that could be automatically configured to call the
generic init also.

and THAT IS NO OVERHEAD, no address fetching to call a simple member, and just
the same as
in C for a inherited member.

My point of view is that there's many code in the kernel to implement generic to
specific inits,
functions for drivers and so on that could be generated by a C++ compiler, with
no overhead
at runtime. Load a module and find the init proc, the io proc, store them in
pointers and
use pointers to functions to use the driver. Thats hand-writen C++.

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



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:08 EST