MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / New

Function New

pkg/cap/section/section.go:36–43  ·  view source on GitHub ↗

New builds a new section block with the specified type, version, optional length and size.

(typ Type, ver capver.Version, l, size uint32)

Source from the content-addressed store, hash-verified

34
35// New builds a new section block with the specified type, version, optional length and size.
36func New(typ Type, ver capver.Version, l, size uint32) Section {
37 var s Section
38 s[0] = uint8(typ)
39 s[1] = uint8(ver)
40 copy(s[2:6], bytes.WriteUint32(l))
41 copy(s[6:], bytes.WriteUint32(size))
42 return s
43}
44
45// Read reads the section from the byte slice.
46func Read(b []byte) Section {

Callers 6

TestPSMarshalerFunction · 0.92
TestPSMarshalerWithPEFunction · 0.92
MarshalMethod · 0.92
wsMethod · 0.92
MarshalRawMethod · 0.92
TestSectionFunction · 0.70

Calls 1

WriteUint32Function · 0.92

Tested by 3

TestPSMarshalerFunction · 0.74
TestPSMarshalerWithPEFunction · 0.74
TestSectionFunction · 0.56