- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 41 for slicedata2 (0.46 sec)
-
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) -
src/strings/compare_test.go
// unsafeString converts a []byte to a string with no allocation. // The caller must not modify b while the result string is in use. unsafeString := func(b []byte) string { return unsafe.String(unsafe.SliceData(b), len(b)) } lengths := make([]int, 0) // lengths to test in ascending order for i := 0; i <= 128; i++ { lengths = append(lengths, i) } lengths = append(lengths, 256, 512, 1024, 1333, 4095, 4096, 4097)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Sep 07 01:33:55 UTC 2022 - 2.8K bytes - Viewed (0) -
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) -
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator.go
func toString(b []byte) string { // unsafe.SliceData relies on cap whereas we want to rely on len if len(b) == 0 { return "" } // Copied from go 1.20.1 strings.Builder.String // https://github.com/golang/go/blob/202a1a57064127c3f19d96df57b9f9586145e21c/src/strings/builder.go#L48 return unsafe.String(unsafe.SliceData(b), len(b)) } // simple recorder that only appends warning
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Jul 03 16:16:51 UTC 2023 - 9.8K bytes - Viewed (0) -
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) -
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) -
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) -
src/crypto/x509/internal/macos/corefoundation.go
//go:cgo_import_dynamic x509_CFDataCreate CFDataCreate "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation" func BytesToCFData(b []byte) CFRef { p := unsafe.Pointer(unsafe.SliceData(b)) ret := syscall(abi.FuncPCABI0(x509_CFDataCreate_trampoline), kCFAllocatorDefault, uintptr(p), uintptr(len(b)), 0, 0, 0) runtime.KeepAlive(p) return CFRef(ret) } func x509_CFDataCreate_trampoline()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Dec 21 20:05:17 UTC 2022 - 8.4K bytes - Viewed (0) -
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) -
src/cmd/vendor/golang.org/x/tools/internal/typesinternal/errorcode.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: Fri May 03 02:38:00 UTC 2024 - 34K bytes - Viewed (0)