- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for unsafeslice (0.31 sec)
-
src/runtime/unsafe.go
// Keep this code in sync with cmd/compile/internal/walk/builtin.go:walkUnsafeSlice func unsafeslice64(et *_type, ptr unsafe.Pointer, len64 int64) { len := int(len64) if int64(len) != len64 { panicunsafeslicelen1(getcallerpc()) } unsafeslice(et, ptr, len) } func unsafeslicecheckptr(et *_type, ptr unsafe.Pointer, len64 int64) { unsafeslice64(et, ptr, len64) // Check that underlying array doesn't straddle multiple heap objects.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 21:51:18 UTC 2024 - 3.1K bytes - Viewed (0) -
src/cmd/compile/internal/walk/builtin.go
// Type checking guarantees that TIDEAL len/cap are positive and fit in an int. // The case of len or cap overflow when converting TUINT or TUINTPTR to TINT // will be handled by the negative range checks in unsafeslice during runtime. if ir.ShouldCheckPtr(ir.CurFunc, 1) { fnname := "unsafeslicecheckptr" fn := typecheck.LookupRuntime(fnname)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 08 22:35:22 UTC 2024 - 31.2K bytes - Viewed (0) -
src/reflect/value.go
// data starts at p, with length and capacity equal to n. // // This is like [unsafe.Slice]. func SliceAt(typ Type, p unsafe.Pointer, n int) Value { unsafeslice(typ.common(), p, n) s := unsafeheader.Slice{Data: p, Len: n, Cap: n} return Value{SliceOf(typ).common(), unsafe.Pointer(&s), flagIndir | flag(Slice)} }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 21:17:41 UTC 2024 - 119.9K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/func.go
n.SetType(nil) return n } if !n.Y.Type().IsInteger() { n.SetType(nil) return n } n.SetType(n.X.Type()) return n } // tcUnsafeSlice typechecks an OUNSAFESLICE node. func tcUnsafeSlice(n *ir.BinaryExpr) *ir.BinaryExpr { n.X = Expr(n.X) n.Y = Expr(n.Y) if n.X.Type() == nil || n.Y.Type() == nil { n.SetType(nil) return n } t := n.X.Type()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 06 15:23:18 UTC 2024 - 21.1K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/universe.go
{"print", ir.OPRINT}, {"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/reflectdata/helpers.go
// and returns an expression that yields the *runtime._type value // representing the result slice type's element type. func UnsafeSliceElemRType(pos src.XPos, n *ir.BinaryExpr) ir.Node { assertOp(n, ir.OUNSAFESLICE) if hasRType(n, n.RType, "RType") { return n.RType } return sliceElemRType(pos, n.Type())
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 12 04:50:32 UTC 2023 - 7.1K bytes - Viewed (0) -
src/cmd/compile/internal/ir/fmt.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 05 15:20:28 UTC 2023 - 26K bytes - Viewed (0) -
src/cmd/compile/internal/walk/walk.go
base.FatalfAt(n.Pos(), "mayCall %+v", n) } switch n.Op() { default: base.FatalfAt(n.Pos(), "mayCall %+v", n) case ir.OCALLFUNC, ir.OCALLINTER, ir.OUNSAFEADD, ir.OUNSAFESLICE: return true case ir.OINDEX, ir.OSLICE, ir.OSLICEARR, ir.OSLICE3, ir.OSLICE3ARR, ir.OSLICESTR, ir.ODEREF, ir.ODOTPTR, ir.ODOTTYPE, ir.ODYNAMICDOTTYPE, ir.ODIV, ir.OMOD, ir.OSLICE2ARR, ir.OSLICE2ARRPTR:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Feb 27 20:56:00 UTC 2024 - 10.4K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/const.go
ir.OLEN, ir.OMAKE, ir.OMAX, ir.OMIN, ir.ONEW, ir.OPANIC, ir.OPRINT, ir.OPRINTLN, ir.OREAL, ir.ORECOVER, ir.ORECOVERFP, ir.ORECV, ir.OUNSAFEADD, ir.OUNSAFESLICE, ir.OUNSAFESLICEDATA, ir.OUNSAFESTRING, ir.OUNSAFESTRINGDATA: return true } return false
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 05 15:20:28 UTC 2023 - 10.5K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/typecheck.go
case ir.ORECOVER: n := n.(*ir.CallExpr) return tcRecover(n) case ir.OUNSAFEADD: n := n.(*ir.BinaryExpr) return tcUnsafeAdd(n) case ir.OUNSAFESLICE: n := n.(*ir.BinaryExpr) return tcUnsafeSlice(n) case ir.OUNSAFESLICEDATA: n := n.(*ir.UnaryExpr) return tcUnsafeData(n) case ir.OUNSAFESTRING: n := n.(*ir.BinaryExpr) return tcUnsafeString(n)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 20 19:08:34 UTC 2024 - 30.5K bytes - Viewed (0)