Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 178 for alignof (0.23 sec)

  1. src/internal/types/testdata/check/builtins0.go

    	unsafe /* ERROR "not used" */ .Alignof(x)
    
    	var y S0
    	assert(unsafe.Alignof(y.a) == 1)
    	assert(unsafe.Alignof(y.b) == 4)
    	assert(unsafe.Alignof(y.c) == 8)
    	assert(unsafe.Alignof(y.d) == 1)
    	assert(unsafe.Alignof(y.e) == 8)
    
    	var s []byte
    	_ = unsafe.Alignof(s)
    	_ = unsafe.Alignof(s... /* ERROR "invalid use of ..." */ )
    }
    
    func Alignof2() {
    	f1 := func() (x int32) { return }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.3K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/builtins_test.go

    	{"Add", `_ = unsafe.Add(nil, 0)`, `func(unsafe.Pointer, int) unsafe.Pointer`},
    
    	{"Alignof", `_ = unsafe.Alignof(0)`, `invalid type`},                 // constant
    	{"Alignof", `var x struct{}; _ = unsafe.Alignof(x)`, `invalid type`}, // constant
    	{"Alignof", `var x P; _ = unsafe.Alignof(x)`, `func(P) uintptr`},
    
    	{"Offsetof", `var x struct{f bool}; _ = unsafe.Offsetof(x.f)`, `invalid type`},           // constant
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 18:06:31 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  3. src/go/types/builtins_test.go

    	{"Add", `_ = unsafe.Add(nil, 0)`, `func(unsafe.Pointer, int) unsafe.Pointer`},
    
    	{"Alignof", `_ = unsafe.Alignof(0)`, `invalid type`},                 // constant
    	{"Alignof", `var x struct{}; _ = unsafe.Alignof(x)`, `invalid type`}, // constant
    	{"Alignof", `var x P; _ = unsafe.Alignof(x)`, `func(P) uintptr`},
    
    	{"Offsetof", `var x struct{f bool}; _ = unsafe.Offsetof(x.f)`, `invalid type`},           // constant
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  4. src/unsafe/unsafe.go

    // of a field of that type within a struct. This case is the same as the
    // value returned by [reflect.TypeOf](s.f).FieldAlign().
    // The return value of Alignof is a Go constant if the type of the argument
    // does not have variable size.
    // (See the description of [Sizeof] for a definition of variable sized types.)
    func Alignof(x ArbitraryType) uintptr
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 19:45:20 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  5. src/go/types/builtins.go

    		}
    
    		x.mode = value
    		x.typ = Typ[UnsafePointer]
    		if check.recordTypes() {
    			check.recordBuiltinType(call.Fun, makeSig(x.typ, x.typ, y.typ))
    		}
    
    	case _Alignof:
    		// unsafe.Alignof(x T) uintptr
    		check.assignment(x, nil, "argument to unsafe.Alignof")
    		if x.mode == invalid {
    			return
    		}
    
    		if hasVarSize(x.typ, nil) {
    			x.mode = value
    			if check.recordTypes() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/builtins.go

    		}
    
    		x.mode = value
    		x.typ = Typ[UnsafePointer]
    		if check.recordTypes() {
    			check.recordBuiltinType(call.Fun, makeSig(x.typ, x.typ, y.typ))
    		}
    
    	case _Alignof:
    		// unsafe.Alignof(x T) uintptr
    		check.assignment(x, nil, "argument to unsafe.Alignof")
    		if x.mode == invalid {
    			return
    		}
    
    		if hasVarSize(x.typ, nil) {
    			x.mode = value
    			if check.recordTypes() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go

    			if t == nil {
    				if ell, ok := fld.Type.(*ast.Ellipsis); ok {
    					t = types.NewSlice(pass.TypesInfo.Types[ell.Elt].Type)
    				}
    			}
    
    			align := int(arch.sizes.Alignof(t))
    			size := int(arch.sizes.Sizeof(t))
    			offset += -offset & (align - 1)
    			cc := componentsOfType(arch, t)
    
    			// names is the list of names with this type.
    			names := fld.Names
    			if len(names) == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 22.8K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/copylock/copylock.go

    	case *ast.Ident:
    		id = fun
    	case *ast.SelectorExpr:
    		id = fun.Sel
    	}
    	if fun, ok := pass.TypesInfo.Uses[id].(*types.Builtin); ok {
    		switch fun.Name() {
    		case "new", "len", "cap", "Sizeof", "Offsetof", "Alignof":
    			return
    		}
    	}
    	for _, x := range ce.Args {
    		if path := lockPathRhs(pass, x); path != nil {
    			pass.ReportRangef(x, "call of %s copies lock value: %v", analysisutil.Format(pass.Fset, ce.Fun), path)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  9. tensorflow/cc/framework/cc_op_gen_util.cc

          // Keywords obtained from http://en.cppreference.com/w/cpp/keyword
          kCPPReserved = new absl::flat_hash_set<StringPiece, StringPieceHasher>{
              "alignas",
              "alignof",
              "and",
              "and_eq",
              "asm",
              "atomic_cancel",
              "atomic_commit",
              "atomic_noexcept",
              "auto",
              "bitand",
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Feb 26 00:57:05 UTC 2024
    - 25K bytes
    - Viewed (0)
  10. src/runtime/syscall_windows.go

    		// caller reserved spill space.
    		p.dstSpill = alignUp(p.dstSpill, uintptr(t.Align_))
    		p.dstSpill += t.Size_
    	} else {
    		// Register assignment failed.
    		// Undo the work and stack assign.
    		p.parts = oldParts
    
    		// The Go ABI aligns arguments.
    		p.dstStackSize = alignUp(p.dstStackSize, uintptr(t.Align_))
    
    		// Copy just the size of the argument. Note that this
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 20:12:46 UTC 2024
    - 16.6K bytes
    - Viewed (0)
Back to top