[lkml]   [2003]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [TRIVIAL] kstrdup (Richard B. Johnson)  wrote on 18.04.03 in <Pine.LNX.4.53.0304181512220.22901@chaos>:

> The test for every byte transferred is, quite obviously, correct.
> It is also, quite obviously, non optimum.

Actually, that is very much not obvious.

Especially if you're familiar with architectures where every move has an
implicit test (typically for zero and sign), and so checking for the zero
byte during the move is quite obviously the only sane thing to do - the
version with a count is slower, because the inner loop does more. (Those
architectures typically don't have a REP-style prefix.)

MfG Kai
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:34    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean