dfs: actually allow current DfsBlock to GC

Holding the current DfsBlock in a local variable 'b' may prevent the
Java GC from reclaiming it while loading the next block.  Remove the
local variable and rely only on the field.

Change-Id: Ibfc8394cac717b485fdc94d5c8479c3f8ca78ee4
This commit is contained in:
Shawn Pearce 2017-07-19 13:56:06 -07:00
parent 3a072c8a7a
commit da0a7c1f3c
1 changed files with 1 additions and 2 deletions

View File

@ -757,8 +757,7 @@ private void prepareInflater() {
}
void pin(DfsPackFile pack, long position) throws IOException {
DfsBlock b = block;
if (b == null || !b.contains(pack.key, position)) {
if (block == null || !block.contains(pack.key, position)) {
// If memory is low, we may need what is in our window field to
// be cleaned up by the GC during the get for the next window.
// So we always clear it, even though we are just going to set