mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-03 12:29:36 +08:00
fix: reuse deserialize result to help improve memory management (#34507)
Fixed #33268 The original reuse is broken by #33359 Signed-off-by: Ted Xu <ted.xu@zilliz.com>
This commit is contained in:
parent
eeb03a0d6a
commit
eae4dfca7b
@ -538,8 +538,9 @@ func (deser *DeserializeReader[T]) Next() error {
|
||||
deser.pos = 0
|
||||
deser.rec = deser.rr.Record()
|
||||
|
||||
// allocate new slice preventing overwrite previous batch
|
||||
deser.values = make([]T, deser.rec.Len())
|
||||
if deser.values == nil || len(deser.values) != deser.rec.Len() {
|
||||
deser.values = make([]T, deser.rec.Len())
|
||||
}
|
||||
if err := deser.deserializer(deser.rec, deser.values); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user