Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 316 for offsetsof (0.23 sec)

  1. src/cmd/compile/internal/types2/sizes_test.go

    	for i := 0; i < ts.NumFields(); i++ {
    		fields = append(fields, ts.Field(i))
    	}
    	offsets := sizes.Offsetsof(fields)
    	if offsets[0] != 0 || offsets[1] != 4 {
    		t.Errorf("OffsetsOf(%v) = %v want %v", ts, offsets, []int{0, 4})
    	}
    }
    
    func TestIssue16902(t *testing.T) {
    	const src = `
    package a
    
    import "unsafe"
    
    const _ = unsafe.Offsetof(struct{ x int64 }{}.x)
    `
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 16 21:00:48 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  2. src/go/types/sizes.go

    }
    
    func (conf *Config) offsetsof(T *Struct) []int64 {
    	var offsets []int64
    	if T.NumFields() > 0 {
    		// compute offsets on demand
    		f := stdSizes.Offsetsof
    		if conf.Sizes != nil {
    			f = conf.Sizes.Offsetsof
    		}
    		offsets = f(T.fields)
    		// sanity checks
    		if len(offsets) != T.NumFields() {
    			panic("implementation of offsetsof returned the wrong number of offsets")
    		}
    	}
    	return offsets
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/sizes.go

    }
    
    func (conf *Config) offsetsof(T *Struct) []int64 {
    	var offsets []int64
    	if T.NumFields() > 0 {
    		// compute offsets on demand
    		f := stdSizes.Offsetsof
    		if conf.Sizes != nil {
    			f = conf.Sizes.Offsetsof
    		}
    		offsets = f(T.fields)
    		// sanity checks
    		if len(offsets) != T.NumFields() {
    			panic("implementation of offsetsof returned the wrong number of offsets")
    		}
    	}
    	return offsets
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  4. src/go/types/sizes_test.go

    	for i := 0; i < ts.NumFields(); i++ {
    		fields = append(fields, ts.Field(i))
    	}
    	offsets := sizes.Offsetsof(fields)
    	if offsets[0] != 0 || offsets[1] != 4 {
    		t.Errorf("OffsetsOf(%v) = %v want %v", ts, offsets, []int{0, 4})
    	}
    }
    
    func TestIssue16902(t *testing.T) {
    	const src = `
    package a
    
    import "unsafe"
    
    const _ = unsafe.Offsetof(struct{ x int64 }{}.x)
    `
    	info := types.Info{Types: make(map[ast.Expr]types.TypeAndValue)}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 16 21:00:48 UTC 2023
    - 4K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/gcsizes.go

    	}
    	return a
    }
    
    func (s *gcSizes) Offsetsof(fields []*Var) []int64 {
    	offsets := make([]int64, len(fields))
    	var offs int64
    	for i, f := range fields {
    		if offs < 0 {
    			// all remaining offsets are too large
    			offsets[i] = -1
    			continue
    		}
    		// offs >= 0
    		a := s.Alignof(f.typ)
    		offs = align(offs, a) // possibly < 0 if align overflows
    		offsets[i] = offs
    		if d := s.Sizeof(f.typ); d >= 0 && offs >= 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  6. src/go/types/gcsizes.go

    	}
    	return a
    }
    
    func (s *gcSizes) Offsetsof(fields []*Var) []int64 {
    	offsets := make([]int64, len(fields))
    	var offs int64
    	for i, f := range fields {
    		if offs < 0 {
    			// all remaining offsets are too large
    			offsets[i] = -1
    			continue
    		}
    		// offs >= 0
    		a := s.Alignof(f.typ)
    		offs = align(offs, a) // possibly < 0 if align overflows
    		offsets[i] = offs
    		if d := s.Sizeof(f.typ); d >= 0 && offs >= 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go

    		fields := make([]*types.Var, tu.NumFields())
    		for i := 0; i < tu.NumFields(); i++ {
    			fields[i] = tu.Field(i)
    		}
    		offsets := arch.sizes.Offsetsof(fields)
    		for i, f := range fields {
    			cc = appendComponentsRecursive(arch, f.Type(), cc, suffix+"_"+f.Name(), off+int(offsets[i]))
    		}
    
    	case asmArray:
    		tu := t.Underlying().(*types.Array)
    		elem := tu.Elem()
    		// Calculate offset of each element array.
    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. api/go1.5.txt

    pkg go/types, type Selection struct
    pkg go/types, type SelectionKind int
    pkg go/types, type Signature struct
    pkg go/types, type Sizes interface { Alignof, Offsetsof, Sizeof }
    pkg go/types, type Sizes interface, Alignof(Type) int64
    pkg go/types, type Sizes interface, Offsetsof([]*Var) []int64
    pkg go/types, type Sizes interface, Sizeof(Type) int64
    pkg go/types, type Slice struct
    pkg go/types, type StdSizes struct
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 30 21:14:09 UTC 2015
    - 46.6K bytes
    - Viewed (0)
  9. src/internal/syscall/unix/siginfo_linux_test.go

    	}
    	ofUid := ofPid + 4
    	ofStatus := ofPid + 8
    
    	offsets := []struct {
    		name string
    		got  uintptr
    		want int
    	}{
    		{"Signo", unsafe.Offsetof(si.Signo), ofSigno},
    		{"Errno", unsafe.Offsetof(si.Errno), ofErrno},
    		{"Code", unsafe.Offsetof(si.Code), ofCode},
    		{"Pid", unsafe.Offsetof(si.Pid), ofPid},
    		{"Uid", unsafe.Offsetof(si.Uid), ofUid},
    		{"Status", unsafe.Offsetof(si.Status), ofStatus},
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 01:23:00 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  10. src/runtime/cpuflags.go

    package runtime
    
    import (
    	"internal/cpu"
    	"unsafe"
    )
    
    // Offsets into internal/cpu records for use in assembly.
    const (
    	offsetX86HasAVX    = unsafe.Offsetof(cpu.X86.HasAVX)
    	offsetX86HasAVX2   = unsafe.Offsetof(cpu.X86.HasAVX2)
    	offsetX86HasERMS   = unsafe.Offsetof(cpu.X86.HasERMS)
    	offsetX86HasRDTSCP = unsafe.Offsetof(cpu.X86.HasRDTSCP)
    
    	offsetARMHasIDIVA = unsafe.Offsetof(cpu.ARM.HasIDIVA)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 23 21:22:58 UTC 2021
    - 810 bytes
    - Viewed (0)
Back to top