Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 37 for slicedata (0.21 sec)

  1. src/internal/fuzz/mutator.go

    	byteSliceOverwriteConstantBytes,
    	byteSliceShuffleBytes,
    	byteSliceSwapBytes,
    }
    
    func (m *mutator) mutateBytes(ptrB *[]byte) {
    	b := *ptrB
    	defer func() {
    		if unsafe.SliceData(*ptrB) != unsafe.SliceData(b) {
    			panic("data moved to new address")
    		}
    		*ptrB = b
    	}()
    
    	for {
    		mut := byteSliceMutators[m.rand(len(byteSliceMutators))]
    		if mutated := mut(m, b); mutated != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 20:01:34 UTC 2023
    - 6.6K bytes
    - Viewed (0)
  2. src/strings/builder.go

    	} else if b.addr != b {
    		panic("strings: illegal use of non-zero Builder copied by value")
    	}
    }
    
    // String returns the accumulated string.
    func (b *Builder) String() string {
    	return unsafe.String(unsafe.SliceData(b.buf), len(b.buf))
    }
    
    // Len returns the number of accumulated bytes; b.Len() == len(b.String()).
    func (b *Builder) Len() int { return len(b.buf) }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 21:09:59 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/typecheck/universe.go

    	{"println", ir.OPRINTLN},
    	{"real", ir.OREAL},
    	{"recover", ir.ORECOVER},
    }
    
    var unsafeFuncs = [...]struct {
    	name string
    	op   ir.Op
    }{
    	{"Add", ir.OUNSAFEADD},
    	{"Slice", ir.OUNSAFESLICE},
    	{"SliceData", ir.OUNSAFESLICEDATA},
    	{"String", ir.OUNSAFESTRING},
    	{"StringData", ir.OUNSAFESTRINGDATA},
    }
    
    // InitUniverse initializes the universe block.
    func InitUniverse() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  4. src/cmd/cgo/internal/testerrors/ptr_test.go

    		fail:    false,
    	},
    	{
    		name:    "slicedata",
    		c:       `void f42(void* p) {}`,
    		imports: []string{"unsafe"},
    		body:    `s := []*byte{nil, new(byte)}; C.f42(unsafe.Pointer(unsafe.SliceData(s)))`,
    		fail:    true,
    	},
    	{
    		name:    "slicedata2",
    		c:       `void f43(void* p) {}`,
    		imports: []string{"unsafe"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 03 16:07:49 UTC 2023
    - 21.2K bytes
    - Viewed (0)
  5. src/internal/types/testdata/check/builtins0.go

    	var _ []int = unsafe.Slice(&x, 0)
    	_ = unsafe.Slice(&x, 1.0)
    	_ = unsafe.Slice((*int)(nil), 0)
    }
    
    func SliceData1() {
    	var s []int
    	unsafe.SliceData(0 /* ERROR "not a slice" */)
    	unsafe /* ERROR "not used" */ .SliceData(s)
    
    	type S []int
    	_ = unsafe.SliceData(s)
    	_ = unsafe.SliceData(S{})
    }
    
    func String1() {
    	var b byte
    	unsafe.String()        // ERROR "not enough arguments"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.3K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/universe.go

    	_Alignof:    {"Alignof", 1, false, expression},
    	_Offsetof:   {"Offsetof", 1, false, expression},
    	_Sizeof:     {"Sizeof", 1, false, expression},
    	_Slice:      {"Slice", 2, false, expression},
    	_SliceData:  {"SliceData", 1, false, expression},
    	_String:     {"String", 2, false, expression},
    	_StringData: {"StringData", 1, false, expression},
    
    	_Assert: {"assert", 1, false, statement},
    	_Trace:  {"trace", 0, true, statement},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  7. src/go/types/universe.go

    	_Alignof:    {"Alignof", 1, false, expression},
    	_Offsetof:   {"Offsetof", 1, false, expression},
    	_Sizeof:     {"Sizeof", 1, false, expression},
    	_Slice:      {"Slice", 2, false, expression},
    	_SliceData:  {"SliceData", 1, false, expression},
    	_String:     {"String", 2, false, expression},
    	_StringData: {"StringData", 1, false, expression},
    
    	_Assert: {"assert", 1, false, statement},
    	_Trace:  {"trace", 0, true, statement},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/builtins.go

    		x.mode = value
    		x.typ = NewSlice(ptr.base)
    		if check.recordTypes() {
    			check.recordBuiltinType(call.Fun, makeSig(x.typ, ptr, y.typ))
    		}
    
    	case _SliceData:
    		// unsafe.SliceData(slice []T) *T
    		check.verifyVersionf(call.Fun, go1_20, "unsafe.SliceData")
    
    		slice, _ := coreType(x.typ).(*Slice)
    		if slice == nil {
    			check.errorf(x, InvalidUnsafeSliceData, invalidArg+"%s is not a slice", x)
    			return
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  9. src/go/types/builtins.go

    		x.mode = value
    		x.typ = NewSlice(ptr.base)
    		if check.recordTypes() {
    			check.recordBuiltinType(call.Fun, makeSig(x.typ, ptr, y.typ))
    		}
    
    	case _SliceData:
    		// unsafe.SliceData(slice []T) *T
    		check.verifyVersionf(call.Fun, go1_20, "unsafe.SliceData")
    
    		slice, _ := coreType(x.typ).(*Slice)
    		if slice == nil {
    			check.errorf(x, InvalidUnsafeSliceData, invalidArg+"%s is not a slice", x)
    			return
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  10. src/log/slog/value.go

    		as2 := make([]Attr, 0, len(as)-n)
    		for _, a := range as {
    			if !a.Value.isEmptyGroup() {
    				as2 = append(as2, a)
    			}
    		}
    		as = as2
    	}
    	return Value{num: uint64(len(as)), any: groupptr(unsafe.SliceData(as))}
    }
    
    // countEmptyGroups returns the number of empty group values in its argument.
    func countEmptyGroups(as []Attr) int {
    	n := 0
    	for _, a := range as {
    		if a.Value.isEmptyGroup() {
    			n++
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 13.3K bytes
    - Viewed (0)
Back to top