Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 41 for Alignof1 (0.13 sec)

  1. test/fixedbugs/issue4654.go

    	defer append(x, 1) // ERROR "defer discards result of append|is not used"
    	defer append(x, 1) // ERROR "defer discards result of append|is not used"
    	defer unsafe.Alignof(t.X) // ERROR "defer discards result of unsafe.Alignof|is not used"
    	defer unsafe.Offsetof(t.X) // ERROR "defer discards result of unsafe.Offsetof|is not used"
    	defer unsafe.Sizeof(t) // ERROR "defer discards result of unsafe.Sizeof|is not used"
    	
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 2.7K bytes
    - Viewed (0)
  2. test/fixedbugs/issue4463.go

    	complex(1, 2)			// ERROR "not used"
    	imag(1i)			// ERROR "not used"
    	len(a)				// ERROR "not used"
    	make([]int, 10)			// ERROR "not used"
    	new(int)			// ERROR "not used"
    	real(1i)			// ERROR "not used"
    	unsafe.Alignof(a)		// ERROR "not used"
    	unsafe.Offsetof(s.f)		// ERROR "not used"
    	unsafe.Sizeof(a)		// ERROR "not used"
    
    	close(c)
    	copy(a, a)
    	delete(m, 0)
    	panic(0)
    	print("foo")
    	println("bar")
    	recover()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 2.4K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. src/internal/types/testdata/fixedbugs/issue40301.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package p
    
    import "unsafe"
    
    func _[T any](x T) {
    	_ = unsafe.Alignof(x)
    	_ = unsafe.Sizeof(x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 02 02:58:32 UTC 2022
    - 256 bytes
    - Viewed (0)
  6. test/typeparam/issue53390.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package p
    
    import "unsafe"
    
    func F[T any](v T) uintptr {
    	return unsafe.Alignof(func() T {
    		func(any) {}(struct{ _ T }{})
    		return v
    	}())
    }
    
    func f() {
    	F(0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jun 18 00:48:50 UTC 2022
    - 334 bytes
    - Viewed (0)
  7. test/fixedbugs/issue7525e.go

    // license that can be found in the LICENSE file.
    
    // Issue 7525: self-referential array types.
    
    package main
    
    import "unsafe"
    
    var x struct { // GC_ERROR "initialization cycle: x refers to itself"
    	c [unsafe.Alignof(x.c)]int // GCCGO_ERROR "array bound|typechecking loop|invalid array"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 29 14:21:33 UTC 2022
    - 413 bytes
    - Viewed (0)
  8. src/cmd/internal/src/xpos_test.go

    	}
    
    	if tab.baseList[0] != nil || tab.indexMap[nil] != 0 {
    		t.Errorf("nil base not at index 0")
    	}
    }
    
    func TestSize(t *testing.T) {
    	var p XPos
    	if unsafe.Alignof(p) != 4 {
    		t.Errorf("alignment = %v; want 4", unsafe.Alignof(p))
    	}
    	if unsafe.Sizeof(p) != 8 {
    		t.Errorf("size = %v; want 8", unsafe.Sizeof(p))
    	}
    }
    
    func TestSetBase(t *testing.T) {
    	var tab PosTable
    	b1 := NewFileBase("b1", "b1")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 01 15:52:41 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  9. test/sizeof.go

    type T2 struct {
    	A int32
    	U2
    }
    
    type U2 struct {
    	B int32
    	C int32
    }
    
    var t2 T2
    var p2 *T2
    
    func main() {
    	// Test unsafe.Sizeof, unsafe.Alignof, and unsafe.Offsetof all return uintptr.
    	isUintptr(unsafe.Sizeof(t))
    	isUintptr(unsafe.Alignof(t))
    	isUintptr(unsafe.Offsetof(t.X))
    
    	// Test correctness of Offsetof with respect to embedded fields (issue 4909).
    	if unsafe.Offsetof(t2.C) != 8 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 2.9K bytes
    - Viewed (0)
  10. test/typeparam/issue48094.dir/a.go

    // license that can be found in the LICENSE file.
    
    package a
    
    import "unsafe"
    
    func F[T any]() uintptr {
    	var t T
    	return unsafe.Sizeof(t)
    }
    
    func G[T any]() uintptr {
    	var t T
    	return unsafe.Alignof(t)
    }
    
    //func H[T any]() uintptr {
    //	type S struct {
    //		a T
    //		b T
    //	}
    //	var s S
    //	return unsafe.Offsetof(s.b)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 31 17:21:38 UTC 2021
    - 429 bytes
    - Viewed (0)
Back to top