C++ in the kernel

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Wed Jan 7 12:54:46 PST 2009

Erik Wikström wrote:
On 2009-01-06 00:48, Simon 'corecode' Schubert wrote:
Erik Wikström wrote:
On 2009-01-05 15:02, B. Estrade wrote:

Is the current code bad or something? What exactly is the problem that
can be "solved" with C++? 
Actually I think the current code is quote good, at least the part's of
it that have been changed the last decade or so. And there is no problem
that can't be solved in C (or Fortran or Ada) that can't be solved in
C++. But fact is that many parts of the kernel uses object oriented
programming, but C does not have support for this at the language level
and C++ does. It is also a fact that current code uses macros to create
generic types (such as lists and queues) and once again this is
something that C++ has language level support for.
I'd like to see a non-ugly template implementation that can be used like 
our current queue.h/tree.h macros.  I don't like C++, but I'd be 
positively surprised it this could be solved elegantly.
I'm not familiar with the queue.h/tree.h macros and what purpose they
serve. A quick look tells me that queue.h gives some macros to create
intrusive lists and queues. Are they intrusive by choice or by
necessity, does the list own objects in it or are they owned by other
objects can possibly part of multiple lists at the same time.  objects are 
not necessarily owned by the list - whatever "owned" might be.  I don't 
know what you mean with intrusive.

  <3 the future  +++  RENT this banner advert  +++   ASCII Ribbon   /"\
  rock the past  +++  space for low €€€ NOW!1  +++     Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \

More information about the Kernel mailing list