FreeBSD: Stop linking _p libs for -pg as of FreeBSD 14
[official-gcc.git] / libgo / go / internal / bytealg / index_native.go
bloba052d49ddc5960f57c01cc176f89be4604573f96
1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 //-go:build amd64 || arm64 || s390x || ppc64le || ppc64
7 package bytealg
9 //go:noescape
11 // Index returns the index of the first instance of b in a, or -1 if b is not present in a.
12 // Requires 2 <= len(b) <= MaxLen.
13 func Index(a, b []byte) int
15 //go:noescape
17 // IndexString returns the index of the first instance of b in a, or -1 if b is not present in a.
18 // Requires 2 <= len(b) <= MaxLen.
19 func IndexString(a, b string) int
21 func Cutover(n int) int {
22 // 1 error per 8 characters, plus a few slop to start.
23 return (n + 16) / 8