Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 34 for Slice (0.15 sec)

  1. src/cmd/asm/internal/lex/slice.go

    	"cmd/internal/src"
    )
    
    // A Slice reads from a slice of Tokens.
    type Slice struct {
    	tokens []Token
    	base   *src.PosBase
    	line   int
    	pos    int
    }
    
    func NewSlice(base *src.PosBase, line int, tokens []Token) *Slice {
    	return &Slice{
    		tokens: tokens,
    		base:   base,
    		line:   line,
    		pos:    -1, // Next will advance to zero.
    	}
    }
    
    func (s *Slice) Next() ScanToken {
    	s.pos++
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Jun 29 22:49:50 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  2. src/arena/arena.go

    //go:linkname runtime_arena_arena_New
    func runtime_arena_arena_New(arena unsafe.Pointer, typ any) any
    
    // Mark as noescape to avoid escaping the slice header.
    //
    //go:noescape
    //go:linkname runtime_arena_arena_Slice
    func runtime_arena_arena_Slice(arena unsafe.Pointer, slice any, cap int)
    
    //go:linkname runtime_arena_arena_Free
    func runtime_arena_arena_Free(arena unsafe.Pointer)
    
    //go:linkname runtime_arena_heapify
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Oct 12 20:23:36 GMT 2022
    - 4.3K bytes
    - Viewed (0)
  3. doc/go1.17_spec.html

    a slice of length up to that capacity can be created by
    <a href="#Slice_expressions"><i>slicing</i></a> a new one from the original slice.
    The capacity of a slice <code>a</code> can be discovered using the
    built-in function <a href="#Length_and_capacity"><code>cap(a)</code></a>.
    </p>
    
    <p>
    A new, initialized slice value for a given element type <code>T</code> is
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 211.6K bytes
    - Viewed (0)
  4. src/bytes/buffer_test.go

    	}()
    
    	buf := NewBuffer(make([]byte, 1))
    	const maxInt = int(^uint(0) >> 1)
    	buf.Grow(maxInt)
    }
    
    // Was a bug: used to give EOF reading empty slice at EOF.
    func TestReadEmptyAtEOF(t *testing.T) {
    	b := new(Buffer)
    	slice := make([]byte, 0)
    	n, err := b.Read(slice)
    	if err != nil {
    		t.Errorf("read error: %v", err)
    	}
    	if n != 0 {
    		t.Errorf("wrong count; got %d want 0", n)
    	}
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  5. src/cmd/cgo/doc.go

    passing a pointer to a field in a struct, the Go memory in question is
    the memory occupied by the field, not the entire struct. When passing a
    pointer to an element in an array or slice, the Go memory in question is
    the entire array or the entire backing array of the slice.
    
    C code may keep a copy of a Go pointer only as long as the memory it
    points to is pinned.
    
    C code may not keep a copy of a Go pointer after the call returns,
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Sun Mar 31 09:02:45 GMT 2024
    - 42.1K bytes
    - Viewed (0)
  6. api/go1.5.txt

    pkg go/types, method (*Signature) String() string
    pkg go/types, method (*Signature) Underlying() Type
    pkg go/types, method (*Signature) Variadic() bool
    pkg go/types, method (*Slice) Elem() Type
    pkg go/types, method (*Slice) String() string
    pkg go/types, method (*Slice) Underlying() Type
    pkg go/types, method (*StdSizes) Alignof(Type) int64
    pkg go/types, method (*StdSizes) Offsetsof([]*Var) []int64
    pkg go/types, method (*StdSizes) Sizeof(Type) int64
    Plain Text
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Jul 30 21:14:09 GMT 2015
    - 46.6K bytes
    - Viewed (0)
  7. src/archive/zip/reader_test.go

    	}
    }
    
    func TestCVE202133196(t *testing.T) {
    	// Archive that indicates it has 1 << 128 -1 files,
    	// this would previously cause a panic due to attempting
    	// to allocate a slice with 1 << 128 -1 elements.
    	data := []byte{
    		0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x08, 0x08,
    		0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 55.3K bytes
    - Viewed (0)
  8. src/bufio/bufio_test.go

    func (r *negativeReader) Read([]byte) (int, error) { return -1, nil }
    
    func TestNegativeRead(t *testing.T) {
    	// should panic with a description pointing at the reader, not at itself.
    	// (should NOT panic with slice index error, for example.)
    	b := NewReader(new(negativeReader))
    	defer func() {
    		switch err := recover().(type) {
    		case nil:
    			t.Fatal("read did not panic")
    		case error:
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Feb 10 18:56:01 GMT 2023
    - 51.5K bytes
    - Viewed (0)
  9. src/builtin/builtin.go

    // it has sufficient capacity, the destination is resliced to accommodate the
    // new elements. If it does not, a new underlying array will be allocated.
    // Append returns the updated slice. It is therefore necessary to store the
    // result of append, often in the variable holding the slice itself:
    //
    //	slice = append(slice, elem1, elem2)
    //	slice = append(slice, anotherSlice...)
    //
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  10. src/bytes/bytes.go

    // Fields interprets s as a sequence of UTF-8-encoded code points.
    // It splits the slice s around each instance of one or more consecutive white space
    // characters, as defined by unicode.IsSpace, returning a slice of subslices of s or an
    // empty slice if s contains only white space.
    func Fields(s []byte) [][]byte {
    	// First count the fields.
    	// This is an exact count if s is ASCII, otherwise it is an approximation.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
Back to top