1
void *memchr_opt(const void *src_void, int c, size_t length)
{
...
if (!TOO_SMALL(length)) {
...
while (length >= LBLOCKSIZE) {
/* XXXXX: Your implementation should appear here */
if (!DETECT_CHAR(*asrc, mask)) {
/* if not find within sizeof(long) bytes */
length -= LBLOCKSIZE;
asrc += 1;
} else {
/* the character is within sizeof(long) bytes */
break;
}
}
/* If there are fewer than LBLOCKSIZE characters left, then we resort to
* the bytewise loop.
*/
src = (unsigned char *) asrc;
}
...
}
2
DDD
: idx++
KKK
: mask + 1
RRR
: &lfr->ring[tail & mask].idx, __ATOMIC_ACQUIRE
HHH
: head + actual
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up