示例#1
0
文件: rocks.go 项目: ngaut/gorockdis
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
}
示例#2
0
文件: utils.go 项目: mijia/rocksq
func makeSlice(s *rocks.Slice) []byte {
	slice := make([]byte, s.Size())
	copy(slice, s.Data())
	s.Free()
	return slice
}