// maxPacketMsgSize returns a maximum size of PacketMsg, including the overhead
// of amino encoding.
960272
func (c *MConnection) maxPacketMsgSize() int {
	return len(cdc.MustMarshalBinaryLengthPrefixed(PacketMsg{
		ChannelID: 0x01,
		EOF:       1,
		Bytes:     make([]byte, c.config.MaxPacketMsgPayloadSize),
	})) + 10 // leave room for changes in amino
}
1270703
func (z *GraphiteTagDelSeriesResp) Msgsize() (s int) {
	s = 1 + 6 + msgp.IntSize + 6 + msgp.MapHeaderSize
	if z.Peers != nil {
		for za0001, za0002 := range z.Peers {
			_ = za0002
			s += msgp.StringPrefixSize + len(za0001) + msgp.IntSize
		}
	}
	return
}
1313044
func GetMaxMsgsz() (int, error) {
	if initVersionError != nil {
		return 0, initVersionError
	}
	if initContextError != nil {
		return 0, initContextError
	}
	return defaultCtx.GetMaxMsgsz()
}
956330
func (z *Tr) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 4
	// string "u"
	o = append(o, 0x84, 0xa1, 0x75)
	o, err = z.UUID.MarshalMsg(o)
	if err != nil {
		return
	}
	// string "c"
	o = append(o, 0xa1, 0x63)
	o = msgp.AppendInt(o, z.Count)
	// string "r"
	o = append(o, 0xa1, 0x72)
	o, err = z.Root.MarshalMsg(o)
	if err != nil {
		return
	}
	// string "nw"
	o = append(o, 0xa2, 0x6e, 0x77)
	o = msgp.AppendInt(o, z.NodeWidth)
	return
}
373595
func (ctx *Context) SetMaxMsgsz(n int) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	return setOption(ctx, C.ZMQ_MAX_MSGSZ, n)
}
1174030
func MaxRecvMsgSize(s int) client.Option {
	return func(o *client.Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, maxRecvMsgSizeKey{}, s)
	}
}
194250
func (z *addHelper16) Msgsize() (s int) {
	s = 1 + 9 + msgp.Uint16Size + 7 + msgp.Uint16Size + 14 + msgp.Uint16Size + 2 + msgp.ArrayHeaderSize + (len(z.m) * (12 + msgp.Uint16Size + msgp.Uint16Size)) + 3
	if z.rc == nil {
		s += msgp.NilSize
	} else {
		s += 1 + 3 + msgp.ArrayHeaderSize + (len(z.rc.iv) * (12 + msgp.Uint16Size + msgp.Uint16Size)) + 5 + msgp.Int64Size
	}
	return
}
886829
func (z AckResp) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 1
	// string "ack"
	o = append(o, 0x81, 0xa3, 0x61, 0x63, 0x6b)
	o = msgp.AppendString(o, z.Ack)
	return
}
913149
func (z Consolidator) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	o = msgp.AppendInt(o, int(z))
	return
}
1259407
func newPacketQueue(maxFreeSlots int) *packetQueue {
	p := &packetQueue{
		outgoingPkts: make(chan *htlcPacket),
		freeSlots:    make(chan struct{}, maxFreeSlots),
		quit:         make(chan struct{}),
	}
	p.queueCond = sync.NewCond(&p.queueMtx)

	return p
}
1108644
func encodeMsgPack(msg interface{}) ([]byte, error) {
	var buf bytes.Buffer
	err := codec.NewEncoder(&buf, msgpackHandle).Encode(msg)
	return buf.Bytes(), err
}
382073
func (z *NestOuter) Msgsize() (s int) {
	s = 1 + 6
	if z.Inner == nil {
		s += msgp.NilSize
	} else {
		s += 1 + 6 + msgp.StringPrefixSize + len(z.Inner.Hello)
	}
	return
}
571300
func MaxPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber {
	if a > b {
		return a
	}
	return b
}
494784
func Dmesg(size int) []byte {
	t := uintptr(3) // SYSLOG_ACTION_READ_ALL
	b := make([]byte, size)
	amt, _, err := unix.Syscall(unix.SYS_SYSLOG, t, uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)))
	if err != 0 {
		return []byte{}
	}
	return b[:amt]
}
816048
func GetMaximumDHCPMessageSize(o dhcp4.Options) (uint16, error) {
	v := o.Get(dhcp4.OptionMaximumDHCPMessageSize)
	if v == nil {
		return 0, dhcp4.ErrOptionNotPresent
	}
	var u Uint16
	return uint16(u), (&u).UnmarshalBinary(v)
}
862667
func (a *InternalMessageInfo) Size(msg Message) int {
	u := getMessageMarshalInfo(msg, a)
	ptr := toPointer(&msg)
	if ptr.isNil() {
		// We get here if msg is a typed nil ((*SomeMessage)(nil)),
		// so it satisfies the interface, and msg == nil wouldn't
		// catch it. We don't want crash in this case.
		return 0
	}
	return u.size(ptr)
}
929426
func (ch *Channel) nextPacketMsg() PacketMsg {
	packet := PacketMsg{}
	packet.ChannelID = byte(ch.desc.ID)
	maxSize := ch.maxPacketMsgPayloadSize
	packet.Bytes = ch.sending[:cmn.MinInt(maxSize, len(ch.sending))]
	if len(ch.sending) <= maxSize {
		packet.EOF = byte(0x01)
		ch.sending = nil
		atomic.AddInt32(&ch.sendQueueSize, -1) // decrement sendQueueSize
	} else {
		packet.EOF = byte(0x00)
		ch.sending = ch.sending[cmn.MinInt(maxSize, len(ch.sending)):]
	}
	return packet
}