// Size implements the protobuf marshalling interface.
551600
func (m *Time) Size() (n int) {
	if m == nil || m.Time.IsZero() {
		return 0
	}
	return m.ProtoTime().Size()
}
792417
func (ix *Reindexer) Size(size int) *Reindexer {
	ix.size = size
	return ix
}
655343
func (s *SearchService) Size(size int) *SearchService {
	s.searchSource = s.searchSource.Size(size)
	return s
}
654114
func (it *Fixed) Size() (int64, bool) {
	return int64(len(it.values)), true
}
1001365
func (p McGroupStatusAnsPayload) Size() int {
	var ansGroupMaskCount int
	for _, mask := range p.Status.AnsGroupMask {
		if mask {
			ansGroupMaskCount++
		}
	}

	return 1 + (5 * ansGroupMaskCount)
}
1341934
func (u *marshalInfo) size(ptr pointer) int {
	if atomic.LoadInt32(&u.initialized) == 0 {
		u.computeMarshalInfo()
	}

	// If the message can marshal itself, let it do it, for compatibility.
	// NOTE: This is not efficient.
	if u.hasmarshaler {
		m := ptr.asPointerTo(u.typ).Interface().(Marshaler)
		b, _ := m.Marshal()
		return len(b)
	}

	n := 0
	for _, f := range u.fields {
		if f.isPointer && ptr.offset(f.field).getPointer().isNil() {
			// nil pointer always marshals to nothing
			continue
		}
		n += f.sizer(ptr.offset(f.field), f.tagsize)
	}
	if u.extensions.IsValid() {
		e := ptr.offset(u.extensions).toExtensions()
		if u.messageset {
			n += u.sizeMessageSet(e)
		} else {
			n += u.sizeExtensions(e)
		}
	}
	if u.v1extensions.IsValid() {
		m := *ptr.offset(u.v1extensions).toOldExtensions()
		n += u.sizeV1Extensions(m)
	}
	if u.unrecognized.IsValid() {
		s := *ptr.offset(u.unrecognized).toBytes()
		n += len(s)
	}
	// cache the result for use in marshal
	if u.sizecache.IsValid() {
		atomic.StoreInt32(ptr.offset(u.sizecache).toInt32(), int32(n))
	}
	return n
}
300251
func Size(size string) (uint64, error) {
	var base uint64 = 1

	s := bytes.TrimSpace([]byte(size))
	switch s[len(s)-1] {
	case 'K', 'k':
		base *= KB
	case 'M', 'm':
		base *= MB
	case 'G', 'g':
		base *= GB
	case 'T', 't':
		base *= TB
	case 'P', 'p':
		base *= PB
	}

	if base > 1 {
		s = s[:len(s)-1]
	}

	bs, err := strconv.Atoi(string(s))
	if err != nil {
		return 0, err
	}

	if bs < 0 {
		bs = 0
	}

	return uint64(bs) * base, nil
}
1333362
func (rwops *RWops) Size() (int64, error) {
	n := int64(C.RWsize(rwops.cptr()))
	if n < 0 {
		return n, GetError()
	}
	return n, nil
}
1022861
func (c Command) Size() int {
	if c.Payload != nil {
		return c.Payload.Size() + 1
	}
	return 1
}
860608
func (f *HttpFile) Size() int64 {
	DebugLog(f.Debug).Println("Size", f.len)
	return f.len
}
465548
func (t *TSMReader) Size() uint32 {
	t.mu.RLock()
	size := t.size
	t.mu.RUnlock()
	return uint32(size)
}
136505
func (c *Cache) Size() int64 {
	c.Lock()
	defer c.Unlock()
	return c.size
}
1198735
func (f *ListenerStack) Size() int {
	f.lock.RLock()
	sz := len(f.listeners)
	f.lock.RUnlock()
	return sz
}
437198
func (infos FieldInfos) Size() int {
	assert(len(infos.byNumber) == len(infos.byName))
	return len(infos.byNumber)
}
661638
func (ps *PeerRoundState) Size() int {
	bs, _ := ps.Marshal()
	return len(bs)
}
974959
func (d *Dtrie) Size() (size int) {
	for _ = range iterate(d.root, nil) {
		size++
	}
	return size
}
502391
func (b *BiMap) Size() int {
	b.s.RLock()
	defer b.s.RUnlock()
	return len(b.forward)
}