[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <271fe5f98088419488caefefea16e736@AcuMS.aculab.com>
Date: Thu, 11 Jan 2024 21:37:02 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Dave Airlie' <airlied@...il.com>, John Hubbard <jhubbard@...dia.com>
CC: "H. Peter Anvin" <hpa@...or.com>, David Howells <dhowells@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"pinskia@...il.com" <pinskia@...il.com>
Subject: RE: [PATCH 00/45] C++: Convert the kernel to C++
> Can we get memory safety with C++ now? and also stop people coding C++
> like it's 1994?
What is the run-time cost?
Things like 'smart pointers' are dumb!
CSTRING is an abomination.
I suspect you need to pass array_pointer:length pairs about in
order to get reasonably array bound checking.
So splitting C's pointer-array equivalence.
But you then need to efficiently return them from functions.
That really needs a register pair be used.
Typically two registers are reserved for function returns,
but are only ever used for double-sized integers.
Doing that without compiler support would be hard work.
The other elephant in the room is compilation speed.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists