// Size returns the encoded size of a protocol buffer.
487363
func Size(pb Message) (n int) {
	// Can the object marshal itself?  If so, Size is slow.
	// TODO: add Size to Marshaler, or add a Sizer interface.
	if m, ok := pb.(Marshaler); ok {
		b, _ := m.Marshal()
		return len(b)
	}

	t, base, err := getbase(pb)
	if structPointer_IsNil(base) {
		return 0
	}
	if err == nil {
		n = size_struct(GetProperties(t.Elem()), base)
	}

	if collectStats {
		stats.Size++
	}

	return
}
949444
func (d *indirectIndex) Size() uint32 {
	d.mu.RLock()
	defer d.mu.RUnlock()

	return d.b.len()
}
661638
func (ps *PeerRoundState) Size() int {
	bs, _ := ps.Marshal()
	return len(bs)
}
1313786
func (pool *hostConnPool) Size() int {
	pool.mu.RLock()
	defer pool.mu.RUnlock()

	return len(pool.conns)
}
602852
func (a Algorithm) Size() int {
	h, ok := algorithms[a]
	if !ok {
		return 0
	}
	return h.Size()
}
310095
func (c *memoryStore) Size() int {
	c.RLock()
	defer c.RUnlock()
	return len(c.s)
}
1143858
func (kvmsg *Kvmsg) Size() int {
	if kvmsg.present[frame_BODY] {
		return len(kvmsg.frame[frame_BODY])
	}
	return 0
}
820029
func (it *Resolver) Size() (int64, bool) {
	return int64(len(it.order)), true
}
237271
func (c *CacheableFilter) Size() (uint64, error) {
	f, err := c.Filter.NBytes()
	if err != nil {
		return 0, err
	}
	return uint64(len(f)), nil
}
376158
func (dkimV3 DeviceKeyInfoMapV3) Size() int {
	// statically-sized part
	mapSize := cache.StaticSizeOfMapWithSize(
		ssCryptPublicKey, ssTLFCryptKeyInfo, len(dkimV3))

	// go through pointer type content
	var contentSize int
	for k, v := range dkimV3 {
		contentSize += len(k.KID())
		contentSize += len(v.ServerHalfID.ID.String())

		// We are not using v.ClientHalf.encryptedData here since that would
		// include the size of struct itself which is already counted in
		// cache.StaticSizeOfMapWithSize.
		contentSize += len(v.ClientHalf.EncryptedData) +
			len(v.ClientHalf.Nonce)
	}

	return mapSize + contentSize
}
741902
func (b *bitmap) size() uintptr {
	return uintptr(len(b.blocks)) * bmBlockWords * uintptrBytes
}
136505
func (c *Cache) Size() int64 {
	c.Lock()
	defer c.Unlock()
	return c.size
}
404845
func (s *UpdateByQueryService) Size(size int) *UpdateByQueryService {
	s.size = &size
	return s
}
1355375
func (c *Corpus) Size() int {
	size := atomic.LoadInt64(&c.maxid)
	return int(size)
}
1148096
func (a *IPRangeAllocator) Size() int64 {
	a.mutex.Lock()
	defer a.mutex.Unlock()
	return a.size
}
846347
func (m *MultiMap) Size() int {
	size := 0
	for _, value := range m.m {
		size += len(value)
	}
	return size
}
945330
func (s *storeImpl) Size() int {
	s.mutex.RLock()
	defer s.mutex.RUnlock()
	return len(s.objects)
}