Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 41 for Alignof1 (0.13 sec)

  1. test/fixedbugs/issue62515.go

    package main
    
    import "unsafe"
    
    func F[G int](g G) (uintptr, uintptr, uintptr) {
    	var c chan func() int
    	type s struct {
    		g G
    		x []int
    	}
    	return unsafe.Sizeof(s{g, make([]int, (<-c)())}),
    		unsafe.Alignof(s{g, make([]int, (<-c)())}),
    		unsafe.Offsetof(s{g, make([]int, (<-c)())}.x)
    }
    
    func main() {
    	F(0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 11 20:48:07 UTC 2023
    - 592 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. test/used.go

    	real(cp)               // ERROR "real\(cp\) .* not used"
    	imag(cp)               // ERROR "imag\(cp\) .* not used"
    	complex(1, 2)          // ERROR "complex\(1, 2\) .* not used"
    	unsafe.Alignof(t.X)    // ERROR "unsafe.Alignof\(t.X\) .* not used"
    	unsafe.Offsetof(t.X)   // ERROR "unsafe.Offsetof\(t.X\) .* not used"
    	unsafe.Sizeof(t)       // ERROR "unsafe.Sizeof\(t\) .* not used"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 28 08:39:17 UTC 2020
    - 6K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tfr/ir/tfr_types.h

        // Allocate a new storage instance.
        auto byteSize = TFRTypeStorage::totalSizeToAlloc<StringAttr>(key.size());
        auto rawMem = allocator.allocate(byteSize, alignof(TFRTypeStorage));
        auto result = ::new (rawMem) TFRTypeStorage(key.size());
    
        // Copy in the string attributes into the trailing storage.
        std::uninitialized_copy(key.begin(), key.end(),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Dec 05 07:17:01 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/sizes_test.go

    		Importer: defaultImporter(),
    		Sizes:    &types2.StdSizes{WordSize: 8, MaxAlign: 8},
    	}
    	mustTypecheck(src, &conf, &info)
    	for _, tv := range info.Types {
    		_ = conf.Sizes.Sizeof(tv.Type)
    		_ = conf.Sizes.Alignof(tv.Type)
    	}
    }
    
    // go.dev/issue/53884.
    func TestAtomicAlign(t *testing.T) {
    	testenv.MustHaveGoBuild(t) // The Go command is needed for the importer to determine the locations of stdlib .a files.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 16 21:00:48 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  6. src/go/types/sizes_test.go

    		Importer: importer.Default(),
    		Sizes:    &types.StdSizes{WordSize: 8, MaxAlign: 8},
    	}
    	mustTypecheck(src, &conf, &info)
    	for _, tv := range info.Types {
    		_ = conf.Sizes.Sizeof(tv.Type)
    		_ = conf.Sizes.Alignof(tv.Type)
    	}
    }
    
    // go.dev/issue/53884.
    func TestAtomicAlign(t *testing.T) {
    	testenv.MustHaveGoBuild(t) // The Go command is needed for the importer to determine the locations of stdlib .a files.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 16 21:00:48 UTC 2023
    - 4K bytes
    - Viewed (0)
  7. 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)
  8. 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},
    	_SliceData:  {"SliceData", 1, 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)
  9. 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},
    	_SliceData:  {"SliceData", 1, 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)
  10. 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)
Back to top