// Size returns a normalized size based on proto.
345025
func Size(proto string, size int) int {
	if proto == "tcp" {
		return dns.MaxMsgSize
	}
	if size < dns.MinMsgSize {
		return dns.MinMsgSize
	}
	return size
}
251990
func (rs *RoundStateSimple) Size() int {
	bs, _ := rs.Marshal()
	return len(bs)
}
811487
func (it *And) Size() (int64, bool) {
	val, b := it.primaryIt.Size()
	for _, sub := range it.internalIterators {
		newval, newb := sub.Size()
		if val > newval {
			val = newval
		}
		b = newb && b
	}
	return val, b
}
974959
func (d *Dtrie) Size() (size int) {
	for _ = range iterate(d.root, nil) {
		size++
	}
	return size
}
820029
func (it *Resolver) Size() (int64, bool) {
	return int64(len(it.order)), true
}
1237729
func (r *Registry) Size() int {
	r.m.RLock()
	defer r.m.RUnlock()
	return len(r.instruments)
}
237271
func (c *CacheableFilter) Size() (uint64, error) {
	f, err := c.Filter.NBytes()
	if err != nil {
		return 0, err
	}
	return uint64(len(f)), nil
}
868049
func (af AttrFormat) Size() int {
	total := 0
	for _, attr := range af {
		total += attr.Type.Size()
	}
	return total
}
501111
func (s *ExpDecaySample) Size() int {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	return s.values.Size()
}
558211
func (f *File) Size() int64 {
	size := int64(f.ino.Size)
	if f.ino.Mode&ifmt == ifreg {
		size |= int64(f.ino.Diracl) << 32
	}
	return size
}
227788
func (d *DisplayBuffer) Size() int {
	return (d.width * d.height) / d.pageSize
}
873811
func (n *node) size() int {
	l := 1
	for _, child := range n.children {
		l += child.size()
	}
	return l
}
104745
func (s *ScanService) Size(size int) *ScanService {
	s.size = &size
	return s
}
413948
func (tx *Tx) Size() int64 {
	return int64(tx.meta.pgid) * int64(tx.db.pageSize)
}
161302
func (bm *BlockMeta) Size() int {
	bs, _ := bm.Marshal()
	return len(bs)
}
1032527
func (s *DeleteByQueryService) Size(size int) *DeleteByQueryService {
	s.size = &size
	return s
}
797578
func (n *Node) Size() (uint64, error) {
	return uint64(len(n.RawData())), nil
}