Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for unsafe_New (0.13 sec)

  1. src/reflect/swapper.go

    			return func(i, j int) { is[i], is[j] = is[j], is[i] }
    		case 1:
    			is := *(*[]int8)(v.ptr)
    			return func(i, j int) { is[i], is[j] = is[j], is[i] }
    		}
    	}
    
    	s := (*unsafeheader.Slice)(v.ptr)
    	tmp := unsafe_New(typ) // swap scratch space
    
    	return func(i, j int) {
    		if uint(i) >= uint(s.Len) || uint(j) >= uint(s.Len) {
    			panic("reflect: slice index out of range")
    		}
    		val1 := arrayAt(s.Data, i, size, "i < s.Len")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:30 UTC 2024
    - 2K bytes
    - Viewed (0)
  2. src/internal/reflectlite/swapper.go

    			return func(i, j int) { is[i], is[j] = is[j], is[i] }
    		case 1:
    			is := *(*[]int8)(v.ptr)
    			return func(i, j int) { is[i], is[j] = is[j], is[i] }
    		}
    	}
    
    	s := (*unsafeheader.Slice)(v.ptr)
    	tmp := unsafe_New(typ) // swap scratch space
    
    	return func(i, j int) {
    		if uint(i) >= uint(s.Len) || uint(j) >= uint(s.Len) {
    			panic("reflect: slice index out of range")
    		}
    		val1 := arrayAt(s.Data, i, size, "i < s.Len")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:30 UTC 2024
    - 2K bytes
    - Viewed (0)
  3. src/internal/reflectlite/value.go

    	switch {
    	case t.IfaceIndir():
    		if v.flag&flagIndir == 0 {
    			panic("bad indir")
    		}
    		// Value is indirect, and so is the interface we're making.
    		ptr := v.ptr
    		if v.flag&flagAddr != 0 {
    			c := unsafe_New(t)
    			typedmemmove(t, c, ptr)
    			ptr = c
    		}
    		e.Data = ptr
    	case v.flag&flagIndir != 0:
    		// Value is indirect, but interface is direct. We need
    		// to load the data at v.ptr into the interface data word.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 17:01:54 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  4. src/reflect/value.go

    	typ := t.common()
    	ptr := unsafe_New(typ)
    	*(*float32)(ptr) = v
    	return Value{typ, ptr, f | flagIndir | flag(typ.Kind())}
    }
    
    // makeComplex returns a Value of type t equal to v (possibly truncated to complex64),
    // where t is a complex64 or complex128 type.
    func makeComplex(f flag, v complex128, t Type) Value {
    	typ := t.common()
    	ptr := unsafe_New(typ)
    	switch typ.Size() {
    	case 8:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
  5. src/internal/reflectlite/export_test.go

    func Zero(typ Type) Value {
    	if typ == nil {
    		panic("reflect: Zero(nil)")
    	}
    	t := typ.common()
    	fl := flag(t.Kind())
    	if t.IfaceIndir() {
    		return Value{t, unsafe_New(t), fl | flagIndir}
    	}
    	return Value{t, nil, fl}
    }
    
    // ToInterface returns v's current value as an interface{}.
    // It is equivalent to:
    //
    //	var i interface{} = (v's underlying value)
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 17:01:54 UTC 2024
    - 3K bytes
    - Viewed (0)
  6. src/runtime/malloc.go

    //
    // Do not remove or change the type signature.
    // See go.dev/issue/67401.
    //
    //go:linkname reflect_unsafe_New reflect.unsafe_New
    func reflect_unsafe_New(typ *_type) unsafe.Pointer {
    	return mallocgc(typ.Size_, typ, true)
    }
    
    //go:linkname reflectlite_unsafe_New internal/reflectlite.unsafe_New
    func reflectlite_unsafe_New(typ *_type) unsafe.Pointer {
    	return mallocgc(typ.Size_, typ, true)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 59.6K bytes
    - Viewed (0)
  7. src/reflect/type.go

    		s = "funcargs(" + stringFor(&t.Type) + ")"
    	}
    	x.Str = resolveReflectName(newName(s, "", false, false))
    
    	// cache result for future callers
    	framePool = &sync.Pool{New: func() any {
    		return unsafe_New(x)
    	}}
    	lti, _ := layoutCache.LoadOrStore(k, layoutType{
    		t:         x,
    		framePool: framePool,
    		abid:      abid,
    	})
    	lt := lti.(layoutType)
    	return lt.t, lt.framePool, lt.abid
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 85.5K bytes
    - Viewed (0)
Back to top