lkml.org 
[lkml]   [2011]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] string: introduce memchr_inv
On Mon, 22 Aug 2011 13:52:18 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> > + value64 = value | value << 8 | value << 16 | value << 24;
> > + value64 = (value64 & 0xffffffff) | value64 << 32;
> > + prefix = 8 - ((unsigned long)start) % 8;
> > +
> > + if (prefix) {
> > + u8 *r = check_bytes8(start, value, prefix);
> > + if (r)
> > + return r;
> > + start += prefix;
> > + bytes -= prefix;
> > + }
> > +
> > + words = bytes / 8;
> > +
> > + while (words) {
> > + if (*(u64 *)start != value64)
>
> OK, problem. This will explode if passed a misaligned address on
> certain (non-x86) architectures.

pls ignore. As Marcin points out, I can't read.


\
 
 \ /
  Last update: 2011-08-22 23:53    [W:2.915 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site