private void addChunk(Chunk chunk) { chunk.acquire(this); if (chunkCount < 3) { chunks[chunkCount++] = chunk; return; } int smallestChunkIdx = 0; if (chunks[1].free() < chunks[0].free()) smallestChunkIdx = 1; if (chunks[2].free() < chunks[smallestChunkIdx].free()) smallestChunkIdx = 2; chunks[smallestChunkIdx].release(); if (smallestChunkIdx != 2) chunks[smallestChunkIdx] = chunks[2]; chunks[2] = chunk; }
private void addChunk(Chunk chunk) { chunk.acquire(this); if (chunkCount < 3) { chunks[chunkCount++] = chunk; return; } int smallestChunkIdx = 0; if (chunks[1].free() < chunks[0].free()) smallestChunkIdx = 1; if (chunks[2].free() < chunks[smallestChunkIdx].free()) smallestChunkIdx = 2; chunks[smallestChunkIdx].release(); if (smallestChunkIdx != 2) chunks[smallestChunkIdx] = chunks[2]; chunks[2] = chunk; }
private void addChunk(Chunk chunk) { chunk.acquire(this); if (chunkCount < 3) { chunks[chunkCount++] = chunk; return; } int smallestChunkIdx = 0; if (chunks[1].free() < chunks[0].free()) smallestChunkIdx = 1; if (chunks[2].free() < chunks[smallestChunkIdx].free()) smallestChunkIdx = 2; chunks[smallestChunkIdx].release(); if (smallestChunkIdx != 2) chunks[smallestChunkIdx] = chunks[2]; chunks[2] = chunk; }
private void addChunk(Chunk chunk) { chunk.acquire(this); if (chunkCount < 3) { chunks[chunkCount++] = chunk; return; } int smallestChunkIdx = 0; if (chunks[1].free() < chunks[0].free()) smallestChunkIdx = 1; if (chunks[2].free() < chunks[smallestChunkIdx].free()) smallestChunkIdx = 2; chunks[smallestChunkIdx].release(); if (smallestChunkIdx != 2) chunks[smallestChunkIdx] = chunks[2]; chunks[2] = chunk; }
public void release() { for (int i = 0 ; i < chunks.length ; i++) { if (chunks[i] != null) { chunks[i].release(); chunks[i] = null; } } } }
public void release() { for (int i = 0 ; i < chunks.length ; i++) { if (chunks[i] != null) { chunks[i].release(); chunks[i] = null; } } } }
public void release() { for (int i = 0 ; i < chunks.length ; i++) { if (chunks[i] != null) { chunks[i].release(); chunks[i] = null; } } } }
public void release() { for (int i = 0 ; i < chunks.length ; i++) { if (chunks[i] != null) { chunks[i].release(); chunks[i] = null; } } } }