Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 138 for indexByte (0.13 sec)

  1. test/fixedbugs/issue24419.go

    	go compare(c)
    	go equal(c)
    	go indexByte(c)
    	go indexByteString(c)
    	<-c
    	<-c
    	<-c
    	<-c
    }
    
    func compare(c chan struct{}) {
    	defer bytes.Compare(nil, nil)
    	growstack(10000)
    	c <- struct{}{}
    }
    func equal(c chan struct{}) {
    	defer bytes.Equal(nil, nil)
    	growstack(10000)
    	c <- struct{}{}
    }
    func indexByte(c chan struct{}) {
    	defer bytes.IndexByte(nil, 0)
    	growstack(10000)
    	c <- struct{}{}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 10 17:13:53 UTC 2018
    - 813 bytes
    - Viewed (0)
  2. src/internal/stringslite/strings.go

    		for i < t {
    			if s[i] != c0 {
    				// IndexByte is faster than bytealg.IndexString, so use it as long as
    				// we're not getting lots of false positives.
    				o := IndexByte(s[i+1:t], c0)
    				if o < 0 {
    					return -1
    				}
    				i += o + 1
    			}
    			if s[i+1] == c1 && s[i:i+n] == substr {
    				return i
    			}
    			fails++
    			i++
    			// Switch to bytealg.IndexString when IndexByte produces too many false positives.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 04 01:23:42 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  3. test/linkname.dir/linkname1.go

    package x
    
    func indexByte(xs []byte, b byte) int { // ERROR "xs does not escape" "can inline indexByte"
    	for i, x := range xs {
    		if x == b {
    			return i
    		}
    	}
    	return -1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 14:25:03 UTC 2021
    - 174 bytes
    - Viewed (0)
  4. src/internal/bytealg/indexbyte_generic.go

    // Copyright 2018 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // Avoid IndexByte and IndexByteString on Plan 9 because it uses
    // SSE instructions on x86 machines, and those are classified as
    // floating point instructions, which are illegal in a note handler.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 17:30:15 UTC 2023
    - 776 bytes
    - Viewed (0)
  5. test/fixedbugs/issue24187.go

    	"unsafe"
    )
    
    func main() {
    	b := make([]byte, 128)
    	for i := range b {
    		b[i] = 1
    	}
    	if bytes.IndexByte(b, 0) != -1 {
    		panic("found 0")
    	}
    	for i := range b {
    		b[i] = 0
    		c := b
    		*(*int)(unsafe.Pointer(uintptr(unsafe.Pointer(&c)) + unsafe.Sizeof(uintptr(0)))) = 1<<31 - 1
    		if bytes.IndexByte(c, 0) != i {
    			panic(fmt.Sprintf("missing 0 at %d\n", i))
    		}
    		b[i] = 1
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 604 bytes
    - Viewed (0)
  6. src/internal/cpu/cpu.go

    			continue
    		}
    
    		*o.Feature = o.Enable
    	}
    }
    
    // indexByte returns the index of the first instance of c in s,
    // or -1 if c is not present in s.
    // indexByte is semantically the same as [strings.IndexByte].
    // We copy this function because "internal/cpu" should not have external dependencies.
    func indexByte(s string, c byte) int {
    	for i := 0; i < len(s); i++ {
    		if s[i] == c {
    			return i
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  7. test/linkname.dir/linkname2.go

    package y
    
    import _ "unsafe"
    
    //go:linkname byteIndex test/linkname1.indexByte
    func byteIndex(xs []byte, b byte) int // ERROR "leaking param: xs"
    
    func ContainsSlash(data []byte) bool { // ERROR "leaking param: data" "can inline ContainsSlash"
    	if byteIndex(data, '/') != -1 {
    		return true
    	}
    	return false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 17:50:47 UTC 2022
    - 310 bytes
    - Viewed (0)
  8. src/internal/bytealg/indexbyte_native.go

    //go:build 386 || (amd64 && !plan9) || s390x || arm || arm64 || loong64 || ppc64 || ppc64le || mips || mipsle || mips64 || mips64le || riscv64 || wasm
    
    package bytealg
    
    //go:noescape
    func IndexByte(b []byte, c byte) int
    
    //go:noescape
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 17:30:15 UTC 2023
    - 438 bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/sys/unix/syscall.go

    // ByteSliceFromString returns a NUL-terminated slice of bytes
    // containing the text of s. If s contains a NUL byte at any
    // location, it returns (nil, EINVAL).
    func ByteSliceFromString(s string) ([]byte, error) {
    	if strings.IndexByte(s, 0) != -1 {
    		return nil, EINVAL
    	}
    	a := make([]byte, len(s)+1)
    	copy(a, s)
    	return a, nil
    }
    
    // BytePtrFromString returns a pointer to a NUL-terminated array of
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  10. src/cmd/vendor/github.com/google/pprof/profile/legacy_java_profile.go

    		b = b[nextNewLine+1:]
    		nextNewLine = bytes.IndexByte(b, byte('\n'))
    	}
    	return b, nil
    }
    
    // parseJavaSamples parses the samples from a java profile and
    // populates the Samples in a profile. Returns the remainder of the
    // buffer after the samples.
    func parseJavaSamples(pType string, b []byte, p *Profile) ([]byte, map[uint64]*Location, error) {
    	nextNewLine := bytes.IndexByte(b, byte('\n'))
    	locs := make(map[uint64]*Location)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 16 15:19:53 UTC 2024
    - 8.8K bytes
    - Viewed (0)
Back to top