Re:The initial proposal for a C++ Ecosystem International St...
by account42 on Wednesday October 19, 2022 @07:04AM
(#33260340)
> You're talking about migrating kernel code to C++, but I'm talking about supporting C++ code in the kernel. That is, if third parties wanted to write Linux drivers, the only supported way was to do it in C.
That hasn't really stopped anyone who wants to write their out of tree drivers in C++.
> That aside, the kernel does do polymorphism the hard way (with unions and arrays of function pointers)
C++ virtual functions are needlessly inefficient for interface classes where you only have a handful instances for each implementation (most commonly only one). Support for something like structs of function pointers with a little bit of sugar so you don't need to explicitly pass the this pointer would be very velcome even outside kernel space.
That hasn't really stopped anyone who wants to write their out of tree drivers in C++.
> That aside, the kernel does do polymorphism the hard way (with unions and arrays of function pointers)
C++ virtual functions are needlessly inefficient for interface classes where you only have a handful instances for each implementation (most commonly only one). Support for something like structs of function pointers with a little bit of sugar so you don't need to explicitly pass the this pointer would be very velcome even outside kernel space.