// Copy returns a copy of the provided bit array.
519420
func (bA *CompactBitArray) Copy() *CompactBitArray {
	if bA == nil {
		return nil
	}
	c := make([]byte, len(bA.Elems))
	copy(c, bA.Elems)
	return &CompactBitArray{
		ExtraBitsStored: bA.ExtraBitsStored,
		Elems:           c,
	}
}
174280
func (s *Scheme) Copy(src Object) (Object, error) {
	dst, err := s.DeepCopy(src)
	if err != nil {
		return nil, err
	}
	return dst.(Object), nil
}
323682
func (v Vector) Copy() Vector {
	nv := make([]Counter, len(v.Counters))
	copy(nv, v.Counters)
	return Vector{Counters: nv}
}
811176
func (h *Histogram) Copy() *Histogram {
	if h.useLocks {
		h.mutex.Lock()
		defer h.mutex.Unlock()
	}

	newhist := New()
	newhist.allocd = h.allocd
	newhist.used = h.used
	newhist.useLocks = h.useLocks

	newhist.bvs = []bin{}
	for _, v := range h.bvs {
		newhist.bvs = append(newhist.bvs, v)
	}

	for i, u := range h.lookup {
		for _, v := range u {
			newhist.lookup[i] = append(newhist.lookup[i], v)
		}
	}

	return newhist
}
853139
func (s *Statement) Copy(dst Code, src Code) *Statement {
	g := &Group{
		close:     ")",
		items:     []Code{dst, src},
		multi:     false,
		name:      "copy",
		open:      "copy(",
		separator: ",",
	}
	*s = append(*s, g)
	return s
}
673611
func CopyBytes(b []byte) (copiedBytes []byte) {
	if b == nil {
		return nil
	}
	copiedBytes = make([]byte, len(b))
	copy(copiedBytes, b)

	return
}
725642
func Copy(src []byte) (dst []byte) {
	dst = make([]byte, len(src))
	copy(dst, src)
	return
}
156005
func (tx *Tx) Copy(w io.Writer) error {
	_, err := tx.WriteTo(w)
	return err
}
954666
func (ib *inputBuffer) copy(d []byte) int {
	// TODO: check all call sites, maybe this can be made more efficient
	return copy(ib.data, d)
}
1179295
func (v ByteView) Copy(dest []byte) int {
	if v.b != nil {
		return copy(dest, v.b)
	}
	return copy(dest, v.s)
}
1150269
func Copy(elements map[string]interface{}) (result map[string]interface{}) {
	result = make(map[string]interface{}, len(elements))
	for k, v := range elements {
		result[k] = v
	}

	return result
}
1302244
func (b Bitmap) Copy() (Bitmap, error) {
	if b == nil {
		return nil, fmt.Errorf("can't copy nil Bitmap")
	}

	raw := make([]byte, len(b))
	copy(raw, b)
	return Bitmap(raw), nil
}
14079
func (immutable *Immutable) copy() *Immutable {
	var root *node
	if immutable.root != nil {
		root = immutable.root.copy()
	}
	cp := &Immutable{
		root:   root,
		number: immutable.number,
		dummy:  *newNode(nil),
	}
	return cp
}
808729
func (n *Node) Copy(c *Node) {
	n.State = c.State
	n.Priority = c.Priority
	n.Host.Copy(&c.Host)
	n.VserversEnabled = c.VserversEnabled
}
883009
func (h *HashMap) Copy() *HashMap {
	cpy := NewHashMap(h.eq, h.hash)
	h.Iter(func(k, v T) bool {
		cpy.Put(k, v)
		return false
	})
	return cpy
}
998463
func Clone(from *Bitset) *Bitset {
	return &Bitset{numBits: from.numBits, bits: from.bits[:]}
}
581339
func (r *AMD64Registers) Copy() proc.Registers {
	var rr AMD64Registers
	rr = *r
	rr.Context = NewCONTEXT()
	*(rr.Context) = *(r.Context)
	rr.fltSave = &rr.Context.FltSave
	return &rr
}