Performs a linear scan of buf from [0 .. buf.length$(RP), returning
the index of the first element matching pat, or buf.length if no match
was found. Comparisons will be performed using the supplied predicate
or '==' if none is supplied.
This function uses the KMP algorithm and offers O(M+N) performance but
must allocate a temporary buffer of size pat.sizeof to do so. If it is
available on the target system, alloca will be used for the allocation,
otherwise a standard dynamic memory allocation will occur.
Performs a linear scan of buf from [0 .. buf.length$(RP), returning the index of the first element matching pat, or buf.length if no match was found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
This function uses the KMP algorithm and offers O(M+N) performance but must allocate a temporary buffer of size pat.sizeof to do so. If it is available on the target system, alloca will be used for the allocation, otherwise a standard dynamic memory allocation will occur.