Exemplo n.º 1
0
func (rh *RocksDBHandler) copySlice(slice *rocks.Slice, toFree bool) []byte {
	data := make([]byte, slice.Size())
	copy(data, slice.Data())
	if toFree {
		slice.Free()
	}
	return data
}
Exemplo n.º 2
0
func makeSlice(s *rocks.Slice) []byte {
	slice := make([]byte, s.Size())
	copy(slice, s.Data())
	s.Free()
	return slice
}