Messages in this thread | | | From | Yejune Deng <> | Date | Tue, 2 Mar 2021 21:55:11 +0800 | Subject | Re: [PATCH] include/linux/slab.h: use for() and left shift to calculate |
| |
Thank you. I hadn't thought of that。
On Tue, Mar 2, 2021 at 5:09 PM Christoph Lameter <cl@gentwo.de> wrote: > > On Tue, 2 Mar 2021, Yejune Deng wrote: > > > use for() and left shift to calculate the value that compared with size. > > There is a reason for the madness... > > The current code was written so compilers can do proper constant folding > and eliminate the whole function entirely. > > If you want this change then please verify that all compilers currently in > use with this code do proper constant folding and never generate code for > the for loop.
| |