Re: [PATCH v2 5/5] Lib: sort.h: replace int size with size_t size in the swap function

2019-04-01 Thread George Spelvin
On Mon, 1 Apr 2019 at 12:35:55 +0300, Andy Shevchenko wrote: > Hmm... If (*swap)() is called recursively it means the change might increase > stack usage on 64-bit platforms. > > Am I missing something? Under what conceivable circumstance would someone write a recursive (*swap)() function? You'r

Re: [PATCH 5/5] Lib: sort.h: replace int size with size_t size in the swap function

2019-03-30 Thread George Spelvin
On Sat, 30 Mar 2019 at 21:24:18 +0100, Greg KH wrote: > On Sat, Mar 30, 2019 at 08:15:49PM +0000, George Spelvin wrote: >> On Sat, 30 Mar 2019 at 19:38:26 +0100 Greh KH wrote; >> > On Sat, Mar 30, 2019 at 07:43:53PM +0300, Andrey Abramov wrote: >>>> Replace int typ

Re: [PATCH 5/5] Lib: sort.h: replace int size with size_t size in the swap function

2019-03-30 Thread George Spelvin
On Sat, 30 Mar 2019 at 19:38:26 +0100 greh k-h wrote; > On Sat, Mar 30, 2019 at 07:43:53PM +0300, Andrey Abramov wrote: >> Replace int type with size_t type of the size argument >> in the swap function, also affect all its dependencies. > > This says _what_ the patch does, but it gives no clue as t

Re: [PATCH 0/5] simple sort swap function usage improvements

2019-03-30 Thread George Spelvin
Great work; that is indeed a logical follow-on. Reviewed by: George Spelvin I you feel even more ambitious, you could try impementing Rasmus Villemoes' idea of having generic *compare* functions. (It's on my to-do list, but I haven't made meaningful progress yet, and I'm

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-07 Thread George Spelvin
Nothing critical, but a bit of kibitzing. (That is slang in the Yiddish language for a person who offers annoying and unwanted advice.) > The binary GCD algorithm is based on the following facts: > 1. If a and b are all evens, then gcd(a,b) = 2 * gcd(a/2, b/2) > 2. If a is even and b i