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 }
func makeSlice(s *rocks.Slice) []byte { slice := make([]byte, s.Size()) copy(slice, s.Data()) s.Free() return slice }