// Length returns the total stack Reactors
431628
func (sr *Stackers) Length() int {
	var l int
	sr.ro.Lock()
	{
		l = len(sr.stacks)
		sr.ro.Unlock()
	}
	return l
}
1183358
func (n *ModuleTreeNode) Size() int {
	s := len(n.Modules)
	for _, c := range n.Children {
		s += c.Size()
	}
	return s
}
782499
func ToLength(i, rpl string, length int) string {
	if len(i) == length {
		return i
	} else if len(i) > length {
		return i[:length]
	} else {
		for idx := 0; idx <= length-len(i); idx++ {
			i += rpl
		}
		return i
	}
}
238981
func (f *StreamsBlockedFrame) Length(_ protocol.VersionNumber) protocol.ByteCount {
	return 1 + utils.VarIntLen(f.StreamLimit)
}
1234130
func (self *Collection) length() Equaler {
	raw := self.coll.Demand()
	if raw == nil {
		return IntEqualer{I: 0}
	}
	return IntEqualer{len(raw.(EqList))}
}
1156627
func (b *Buffer) Len() int {
	b.Lock()
	defer b.Unlock()

	return b.length()
}
155980
func (udh *UDH) Len() int {
	return udh.IEI.Len() + udh.IELength.Len() + udh.IEData.Len()
}
435173
func (i Interval) Length() float64 {
	l := i.Hi - i.Lo
	if l >= 0 {
		return l
	}
	l += 2 * math.Pi
	if l > 0 {
		return l
	}
	return -1
}
327187
func (f *StreamDataBlockedFrame) Length(version protocol.VersionNumber) protocol.ByteCount {
	return 1 + utils.VarIntLen(uint64(f.StreamID)) + utils.VarIntLen(uint64(f.DataLimit))
}
857053
func (f *MaxDataFrame) Length(version protocol.VersionNumber) protocol.ByteCount {
	return 1 + utils.VarIntLen(uint64(f.ByteOffset))
}
343525
func (s Slice) Length() (ValueLength, error) {
	if !s.IsArray() && !s.IsObject() {
		return 0, InvalidTypeError{"Expecting type Array or Object"}
	}

	h := s.head()
	if h == 0x01 || h == 0x0a {
		// special case: empty!
		return 0, nil
	}

	if h == 0x13 || h == 0x14 {
		// compact Array or Object
		end := readVariableValueLength(s, 1, false)
		return readVariableValueLength(s, end-1, true), nil
	}

	offsetSize := indexEntrySize(h)
	vpackAssert(offsetSize > 0)
	end := readIntegerNonEmpty(s[1:], offsetSize)

	// find number of items
	if h <= 0x05 { // No offset table or length, need to compute:
		firstSubOffset := s.findDataOffset(h)
		first := s[firstSubOffset:]
		s, err := first.ByteSize()
		if err != nil {
			return 0, WithStack(err)
		}
		if s == 0 {
			return 0, WithStack(InternalError)
		}
		return (ValueLength(end) - firstSubOffset) / s, nil
	} else if offsetSize < 8 {
		return ValueLength(readIntegerNonEmpty(s[offsetSize+1:], offsetSize)), nil
	}

	return ValueLength(readIntegerNonEmpty(s[end-uint64(offsetSize):], offsetSize)), nil
}
945330
func (s *storeImpl) Size() int {
	s.mutex.RLock()
	defer s.mutex.RUnlock()
	return len(s.objects)
}
185294
func Length(x uint64) int {
	if x < 10 {
		return 1
	}
	// From https://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
	r := int((bits.Len64(x) * 1233) >> 12)
	if p, _ := Pow10(uint64(r)); x < p {
		return r
	}
	return r + 1
}
801472
func (g *LinearRing) Length() float64 {
	return length1(g.flatCoords, 0, len(g.flatCoords), g.stride)
}
1209447
func (g *LineString) Length() float64 {
	return length1(g.flatCoords, 0, len(g.flatCoords), g.stride)
}
267858
func (e JSONEvent) Length() int {
	bytes, _ := e.Encode()
	return len(bytes)
}
234751
func getlength(bs *BlockDriverState) (int64, error) {
	length, err := nbSectors(bs)
	if err != nil {
		return 0, err
	}

	if length > int64(INT64_MAX/BDRV_SECTOR_SIZE) {
		return 0, syscall.EFBIG
	}
	return length * int64(BDRV_SECTOR_SIZE), nil
}