Documentation ¶
Index ¶
- func Align(x int64, a int64) int64
- func CopyField(f gopium.Field) gopium.Field
- func CopyStruct(s gopium.Struct) gopium.Struct
- func PadField(pad int64) gopium.Field
- func SizeAlignPtr(st gopium.Struct) (int64, int64, int64)
- func WalkStruct(st gopium.Struct, sysalign int64, onpad OnPadFields)
- type Boundaries
- type Boundary
- type Flat
- type Hierarchic
- func (h Hierarchic) Cat(cat string) (map[string]gopium.Struct, bool)
- func (h Hierarchic) Catflat(cat string) (Flat, bool)
- func (h Hierarchic) Flat() Flat
- func (h Hierarchic) Full() map[string]gopium.Struct
- func (h Hierarchic) Len() int
- func (h Hierarchic) Push(key string, cat string, sts ...gopium.Struct)
- func (h Hierarchic) Rcat() string
- type OnPadFields
- type Reference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Align ¶
Align returns the smallest y >= x such that y % a == 0. note: copied from `go/types/sizes.go`
func CopyStruct ¶
CopyStruct defines helper that deep copies provided struct
func SizeAlignPtr ¶ added in v1.6.0
SizeAlignPtr calculates sturct aligned size, size and ptr size by using walk struct helper
func WalkStruct ¶
func WalkStruct(st gopium.Struct, sysalign int64, onpad OnPadFields)
WalkStruct iterates over structure fields with optional system align and calls on pad fields callback for all pads and fields
Types ¶
type Boundary ¶
type Boundary struct { First token.Pos `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"` Last token.Pos `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"` } // struct size: 16 bytes; struct align: 8 bytes; struct aligned size: 16 bytes; struct ptr scan size: 0 bytes; - 🌺 gopium @1pkg
Boundary defines sorted pos pair type
type Hierarchic ¶
type Hierarchic struct { // contains filtered or unexported fields } // struct size: 32 bytes; struct align: 8 bytes; struct aligned size: 32 bytes; struct ptr scan size: 16 bytes; - 🌺 gopium @1pkg
Hierarchic defines strucs hierarchic collection which is categorized by pair of loc and id
func NewHierarchic ¶
func NewHierarchic(rcat string) Hierarchic
NewHierarchic creates new hierarchic collection with root category
func (Hierarchic) Catflat ¶
func (h Hierarchic) Catflat(cat string) (Flat, bool)
Catflat returns hierarchic categoty flat collection if any exists
func (Hierarchic) Flat ¶
func (h Hierarchic) Flat() Flat
Flat converts hierarchic collection to flat collection
func (Hierarchic) Full ¶
func (h Hierarchic) Full() map[string]gopium.Struct
Full converts hierarchic collection to flat collection
func (Hierarchic) Len ¶
func (h Hierarchic) Len() int
Len calculates total len of hierarchic collection
func (Hierarchic) Push ¶
func (h Hierarchic) Push(key string, cat string, sts ...gopium.Struct)
Push adds struct to hierarchic collection
func (Hierarchic) Rcat ¶
func (h Hierarchic) Rcat() string
Rcat finds root category that all other category contain for collection
type OnPadFields ¶
OnPadFields defines pad fields callback that accepts pad and optional list of following structure fields
type Reference ¶
type Reference struct { // contains filtered or unexported fields } // struct size: 32 bytes; struct align: 8 bytes; struct aligned size: 32 bytes; struct ptr scan size: 16 bytes; - 🌺 gopium @1pkg
Reference defines backreference helper that helps to set, and get wait for key value pairs
func NewReference ¶
NewReference creates reference instance accordingly to passed nil flag