Only free in replicate if we did not hold the reference in window stage

And then free when we are consuming blobs
This commit is contained in:
Stephen Akridge
2018-06-26 13:45:05 -07:00
committed by Greg Fitzgerald
parent 6e568c69a7
commit f4c4b9df9c
2 changed files with 12 additions and 2 deletions

View File

@@ -331,7 +331,12 @@ fn recv_window(
let block_start = *consumed - (*consumed % erasure::NUM_CODED);
let coding_end = block_start + erasure::NUM_CODED;
// We've received all this block's data blobs, go and null out the window now
for j in block_start..coding_end {
for j in block_start..*consumed {
if let Some(b) = mem::replace(&mut window[j % WINDOW_SIZE], None) {
recycler.recycle(b);
}
}
for j in *consumed..coding_end {
window[j % WINDOW_SIZE] = None;
}