MCPcopy
hub / github.com/tinygo-org/tinygo / Offsetsof

Method Offsetsof

compiler/sizes.go:68–78  ·  view source on GitHub ↗
(fields []*types.Var)

Source from the content-addressed store, hash-verified

66}
67
68func (s *stdSizes) Offsetsof(fields []*types.Var) []int64 {
69 offsets := make([]int64, len(fields))
70 var o int64
71 for i, f := range fields {
72 a := s.Alignof(f.Type())
73 o = align(o, a)
74 offsets[i] = o
75 o += s.Sizeof(f.Type())
76 }
77 return offsets
78}
79
80var basicSizes = [...]byte{
81 types.Bool: 1,

Callers 1

SizeofMethod · 0.95

Calls 4

AlignofMethod · 0.95
SizeofMethod · 0.95
alignFunction · 0.70
TypeMethod · 0.45

Tested by

no test coverage detected