memchr

Finds the index of elem in src within 0..len using SIMD intrinsics.

Assumes that len is a multiple of 16 and undefined behavior if T is not an integral or vector size.

@nogc pragma(inline)
size_t
memchr
(
uint DIR
T
)
(
const scope void* src
,
size_t len
,
const scope T elem
)

Parameters

DIR

Direction to count in, will find index if DIR == 0 or last index if DIR == 1.

src void*

Data source pointer.

len size_t

Length of data to be memchrned.

elem T

Data to be searched for.

Meta