Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for Alignof (0.1 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/unsafe/unsafe.go

    // As a special case, if a variable s is of struct type and f is a field
    // within that struct, then Alignof(s.f) will return the required alignment
    // 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.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 19:45:20 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/universe.go

    	_Println: {"println", 0, true, statement},
    	_Real:    {"real", 1, false, expression},
    	_Recover: {"recover", 0, false, statement},
    
    	_Add:        {"Add", 2, false, expression},
    	_Alignof:    {"Alignof", 1, false, expression},
    	_Offsetof:   {"Offsetof", 1, false, expression},
    	_Sizeof:     {"Sizeof", 1, false, expression},
    	_Slice:      {"Slice", 2, false, expression},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  4. src/go/types/universe.go

    	_Println: {"println", 0, true, statement},
    	_Real:    {"real", 1, false, expression},
    	_Recover: {"recover", 0, false, statement},
    
    	_Add:        {"Add", 2, false, expression},
    	_Alignof:    {"Alignof", 1, false, expression},
    	_Offsetof:   {"Offsetof", 1, false, expression},
    	_Sizeof:     {"Sizeof", 1, false, expression},
    	_Slice:      {"Slice", 2, false, expression},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.3K 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

    			log.Printf("unknown architecture %s", arch.name)
    		}
    		arch.intSize = int(arch.sizes.Sizeof(types.Typ[types.Int]))
    		arch.ptrSize = int(arch.sizes.Sizeof(types.Typ[types.UnsafePointer]))
    		arch.maxAlign = int(arch.sizes.Alignof(types.Typ[types.Int64]))
    	}
    }
    
    var (
    	re           = regexp.MustCompile
    	asmPlusBuild = re(`//\s+\+build\s+([^\n]+)`)
    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. doc/go1.17_spec.html

    <li>For a variable <code>x</code> of any type: <code>unsafe.Alignof(x)</code> is at least 1.
    </li>
    
    <li>For a variable <code>x</code> of struct type: <code>unsafe.Alignof(x)</code> is the largest of
       all the values <code>unsafe.Alignof(x.f)</code> for each field <code>f</code> of <code>x</code>, but at least 1.
    </li>
    
    <li>For a variable <code>x</code> of array type: <code>unsafe.Alignof(x)</code> is the same as
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 20:22:45 UTC 2024
    - 211.6K bytes
    - Viewed (0)
  10. doc/go_spec.html

    <li>For a variable <code>x</code> of any type: <code>unsafe.Alignof(x)</code> is at least 1.
    </li>
    
    <li>For a variable <code>x</code> of struct type: <code>unsafe.Alignof(x)</code> is the largest of
       all the values <code>unsafe.Alignof(x.f)</code> for each field <code>f</code> of <code>x</code>, but at least 1.
    </li>
    
    <li>For a variable <code>x</code> of array type: <code>unsafe.Alignof(x)</code> is the same as
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 21:07:21 UTC 2024
    - 281.5K bytes
    - Viewed (0)
Back to top