Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 48 for buf4 (0.05 sec)

  1. test/fixedbugs/issue7690.go

    import (
    	"bytes"
    	"regexp"
    	"runtime"
    	"strconv"
    )
    
    func main() {
    	buf1 := make([]byte, 1000)
    	buf2 := make([]byte, 1000)
    
    	runtime.Stack(buf1, false)      // CALL is last instruction on this line
    	n := runtime.Stack(buf2, false) // CALL is followed by load of result from stack
    
    	buf1 = buf1[:bytes.IndexByte(buf1, 0)]
    	buf2 = buf2[:n]
    
    	re := regexp.MustCompile(`(?m)^main\.main\(\)\n.*/issue7690.go:([0-9]+)`)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 1.2K bytes
    - Viewed (0)
  2. src/compress/flate/reader_test.go

    	doBench(b, func(b *testing.B, buf0 []byte, level, n int) {
    		b.ReportAllocs()
    		b.StopTimer()
    		b.SetBytes(int64(n))
    
    		compressed := new(bytes.Buffer)
    		w, err := NewWriter(compressed, level)
    		if err != nil {
    			b.Fatal(err)
    		}
    		for i := 0; i < n; i += len(buf0) {
    			if len(buf0) > n-i {
    				buf0 = buf0[:n-i]
    			}
    			io.Copy(w, bytes.NewReader(buf0))
    		}
    		w.Close()
    		buf1 := compressed.Bytes()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 09 19:12:23 UTC 2020
    - 2.3K bytes
    - Viewed (0)
  3. test/fixedbugs/issue4099.go

    // The noescape comment only applies to the next func,
    // which must not have a body.
    
    //go:noescape
    
    func F1([]byte)
    
    func F2([]byte)
    
    func G() {
    	var buf1 [10]byte
    	F1(buf1[:])
    
    	var buf2 [10]byte // ERROR "moved to heap: buf2"
    	F2(buf2[:])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 509 bytes
    - Viewed (0)
  4. src/compress/flate/writer_test.go

    	"runtime"
    	"testing"
    )
    
    func BenchmarkEncode(b *testing.B) {
    	doBench(b, func(b *testing.B, buf0 []byte, level, n int) {
    		b.StopTimer()
    		b.SetBytes(int64(n))
    
    		buf1 := make([]byte, n)
    		for i := 0; i < n; i += len(buf0) {
    			if len(buf0) > n-i {
    				buf0 = buf0[:n-i]
    			}
    			copy(buf1[i:], buf0)
    		}
    		buf0 = nil
    		w, err := NewWriter(io.Discard, level)
    		if err != nil {
    			b.Fatal(err)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 5.4K bytes
    - Viewed (0)
  5. src/compress/lzw/writer_test.go

    }
    
    func BenchmarkEncoder(b *testing.B) {
    	buf, err := os.ReadFile("../testdata/e.txt")
    	if err != nil {
    		b.Fatal(err)
    	}
    	if len(buf) == 0 {
    		b.Fatalf("test file has no data")
    	}
    
    	for e := 4; e <= 6; e++ {
    		n := int(math.Pow10(e))
    		buf0 := buf
    		buf1 := make([]byte, n)
    		for i := 0; i < n; i += len(buf0) {
    			if len(buf0) > n-i {
    				buf0 = buf0[:n-i]
    			}
    			copy(buf1[i:], buf0)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 12 11:00:47 UTC 2021
    - 5.7K bytes
    - Viewed (0)
  6. src/unicode/utf8/example_test.go

    	}
    	for i, c := range runes {
    		buf := make([]byte, 3)
    		size := utf8.EncodeRune(buf, c)
    		fmt.Printf("%d: %d %[2]s %d\n", i, buf, size)
    	}
    	// Output:
    	// 0: [239 191 189] � 3
    	// 1: [239 191 189] � 3
    	// 2: [239 191 189] � 3
    }
    
    func ExampleFullRune() {
    	buf := []byte{228, 184, 150} // 世
    	fmt.Println(utf8.FullRune(buf))
    	fmt.Println(utf8.FullRune(buf[:2]))
    	// Output:
    	// true
    	// false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 05 21:29:18 UTC 2021
    - 3.6K bytes
    - Viewed (0)
  7. src/io/example_test.go

    	// read
    }
    
    func ExampleMultiWriter() {
    	r := strings.NewReader("some io.Reader stream to be read\n")
    
    	var buf1, buf2 strings.Builder
    	w := io.MultiWriter(&buf1, &buf2)
    
    	if _, err := io.Copy(w, r); err != nil {
    		log.Fatal(err)
    	}
    
    	fmt.Print(buf1.String())
    	fmt.Print(buf2.String())
    
    	// Output:
    	// some io.Reader stream to be read
    	// some io.Reader stream to be read
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 15:49:32 UTC 2022
    - 5.5K bytes
    - Viewed (0)
  8. src/crypto/ecdh/nist.go

    		panic("crypto/ecdh: internal error: isLess input too large")
    	}
    	bufA, bufB := make([]byte, 72), make([]byte, 72)
    	for i := range a {
    		bufA[i], bufB[i] = a[len(a)-i-1], b[len(b)-i-1]
    	}
    
    	// Perform a subtraction with borrow.
    	var borrow uint64
    	for i := 0; i < len(bufA); i += 8 {
    		limbA, limbB := byteorder.LeUint64(bufA[i:]), byteorder.LeUint64(bufB[i:])
    		_, borrow = bits.Sub64(limbA, limbB, borrow)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  9. src/cmd/internal/bio/buf.go

    Cherry Zhang <******@****.***> 1596156569 -0400
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 11 17:15:15 UTC 2020
    - 3.1K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/runtime/allocator_test.go

    	target := &Allocator{}
    	initialSize := 1000000 // 1MB
    	buff := target.Allocate(uint64(initialSize))
    	if cap(buff) < initialSize {
    		t.Fatalf("unexpected size of the buffer, expected at least 1MB, got: %v", cap(buff))
    	}
    	if len(buff) != initialSize {
    		t.Fatalf("unexpected length of the buffer, expected: %v, got: %v", initialSize, len(buff))
    	}
    
    	buff = target.Allocate(0)
    	if cap(buff) < initialSize {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Feb 23 13:38:29 UTC 2022
    - 2.4K bytes
    - Viewed (0)
Back to top