Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 41 for slicedata2 (0.47 sec)

  1. src/internal/types/errors/codes.go

    	MisplacedTypeParam
    
    	// InvalidUnsafeSliceData occurs when unsafe.SliceData is called with
    	// an argument that is not of slice type. It also occurs if it is used
    	// in a package compiled for a language version before go1.20.
    	//
    	// Example:
    	//  import "unsafe"
    	//
    	//  var x int
    	//  var _ = unsafe.SliceData(x)
    	InvalidUnsafeSliceData
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 22:50:48 UTC 2024
    - 33.7K bytes
    - Viewed (0)
  2. src/syscall/fs_wasip1.go

    	)
    	return errnoErr(errno)
    }
    
    func Fsync(fd int) error {
    	errno := fd_sync(int32(fd))
    	return errnoErr(errno)
    }
    
    func bytesPointer(b []byte) unsafe.Pointer {
    	return unsafe.Pointer(unsafe.SliceData(b))
    }
    
    func stringPointer(s string) unsafe.Pointer {
    	return unsafe.Pointer(unsafe.StringData(s))
    }
    
    func makeIOVec(b []byte) unsafe.Pointer {
    	return unsafe.Pointer(&iovec{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 24.1K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ir/fmt.go

    	OSELECT:           "select",
    	OSEND:             "<-",
    	OSUB:              "-",
    	OSWITCH:           "switch",
    	OUNSAFEADD:        "unsafe.Add",
    	OUNSAFESLICE:      "unsafe.Slice",
    	OUNSAFESLICEDATA:  "unsafe.SliceData",
    	OUNSAFESTRING:     "unsafe.String",
    	OUNSAFESTRINGDATA: "unsafe.StringData",
    	OXOR:              "^",
    }
    
    // GoString returns the Go syntax for the Op, or else its name.
    func (o Op) GoString() string {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 26K bytes
    - Viewed (0)
  4. src/cmd/go/internal/modindex/read.go

    	for i := range ret {
    		ret[i] = build.Directive{Text: r.string(), Pos: r.tokpos()}
    	}
    	return ret
    }
    
    func asString(b []byte) string {
    	return unsafe.String(unsafe.SliceData(b), len(b))
    }
    
    // A decoder helps decode the index format.
    type decoder struct {
    	data []byte // data after header
    	str  []byte // string table
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 14:34:32 UTC 2024
    - 29.7K bytes
    - Viewed (0)
  5. src/bytes/bytes_test.go

    		}
    
    		if input != nil && clone == nil {
    			t.Errorf("Clone(%#v) return value should not be equal to nil slice.", input)
    		}
    
    		if cap(input) != 0 && unsafe.SliceData(input) == unsafe.SliceData(clone) {
    			t.Errorf("Clone(%q) return value should not reference inputs backing memory.", input)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 56.5K bytes
    - Viewed (0)
  6. src/syscall/syscall_windows.go

    			// (total of 6) and overestimate by 2 bytes for the pair,
    			// since the resulting rune only requires 4 bytes.
    			maxLen += 3
    		}
    	}
    	buf := decodeWTF16(s, make([]byte, 0, maxLen))
    	return unsafe.String(unsafe.SliceData(buf), len(buf))
    }
    
    // utf16PtrToString is like UTF16ToString, but takes *uint16
    // as a parameter instead of []uint16.
    func utf16PtrToString(p *uint16) string {
    	if p == nil {
    		return ""
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 11:49:46 UTC 2024
    - 52.7K bytes
    - Viewed (0)
  7. src/cmd/cgo/gcc.go

    		*ast.MapType, *ast.ChanType:
    
    		return true
    	}
    	return false
    }
    
    // isUnsafeData reports whether the expression is unsafe.StringData
    // or unsafe.SliceData. We can ignore these when checking for pointers
    // because they don't change whether or not their argument contains
    // any Go pointers. If onlyStringData is true we only check for StringData.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 97K bytes
    - Viewed (0)
  8. doc/go_spec.html

    <p>
    The following built-in functions are not permitted in statement context:
    </p>
    
    <pre>
    append cap complex imag len make new real
    unsafe.Add unsafe.Alignof unsafe.Offsetof unsafe.Sizeof unsafe.Slice unsafe.SliceData unsafe.String unsafe.StringData
    </pre>
    
    <pre>
    h(x+y)
    f.Close()
    &lt;-ch
    (&lt;-ch)
    len("foo")  // illegal if len is the built-in function
    </pre>
    
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 21:07:21 UTC 2024
    - 281.5K bytes
    - Viewed (1)
  9. src/reflect/value.go

    // it references will not be garbage collected, so programs must keep
    // a separate, correctly typed pointer to the underlying data.
    //
    // Deprecated: Use unsafe.Slice or unsafe.SliceData instead.
    type SliceHeader struct {
    	Data uintptr
    	Len  int
    	Cap  int
    }
    
    func typesMustMatch(what string, t1, t2 Type) {
    	if t1 != t2 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
  10. src/reflect/all_test.go

    		{"unsafe.Pointer", ValueOf(unsafePtr), unsafePtr},
    		{"function", ValueOf(fn), **(**unsafe.Pointer)(unsafe.Pointer(&fn))},
    		{"slice", ValueOf(slice), unsafe.Pointer(unsafe.SliceData(slice))},
    		{"string", ValueOf(s), unsafe.Pointer(unsafe.StringData(s))},
    	}
    
    	for _, tc := range tests {
    		tc := tc
    		t.Run(tc.name, func(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top