Revert "Add double-free detection code to the pools"

This reverts commit 9cdcfd2522febcc2eb7f65d926a37cfa05f21323.
This commit is contained in:
Cameron Gutman
2013-11-21 16:25:01 -05:00
parent 45120e79e4
commit 3efa356bb8
3 changed files with 3 additions and 50 deletions
@@ -6,8 +6,6 @@ public class AvShortBufferPool {
private ConcurrentLinkedQueue<short[]> bufferList = new ConcurrentLinkedQueue<short[]>();
private int bufferSize;
private static final boolean doubleFreeDebug = true;
public AvShortBufferPool(int size)
{
this.bufferSize = size;
@@ -20,13 +18,7 @@ public class AvShortBufferPool {
public short[] allocate()
{
short[] buff;
if (doubleFreeDebug) {
buff = null;
}
else {
buff = bufferList.poll();
}
short[] buff = bufferList.poll();
if (buff == null) {
buff = new short[bufferSize];
}
@@ -35,14 +27,6 @@ public class AvShortBufferPool {
public void free(short[] buffer)
{
if (doubleFreeDebug) {
for (short[] buf : bufferList) {
if (buf == buffer) {
throw new IllegalStateException("Double free detected");
}
}
}
bufferList.add(buffer);
}
}