[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49231a98-d39f-4920-8d9f-e60aa014f518@zytor.com>
Date: Thu, 11 Jan 2024 18:54:41 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: David Howells <dhowells@...hat.com>, linux-kernel@...r.kernel.org,
pinskia@...il.com
Subject: Re: [PATCH 00/45] C++: Convert the kernel to C++
One thing I forgot to mention that would be quite useful is careful use
of namespaces. For example, putting init functions in their own
namespace would have not only make it a lot harder to call init
functions from non-init functions by mistake (calling init::func()
explicitly is a highly visible "I really do mean to do this."
However, it also let us do separate init versions of functions like
cpu_feature_enable() that contain optimizations that aren't actually
usable at init time (alternatives have not been applied.) The idea is
*not* to change the code, but rather the compiler will simply prefer
init:: functions from inside other init:: functions (a direct
consequence of how namespaces work.)
-hpa
Powered by blists - more mailing lists