1
package org.postgresql.core;
3
public class BytePoolDim2
6
ObjectPool notusemap[] = new ObjectPool[maxsize + 1];
7
ObjectPool inusemap[] = new ObjectPool[maxsize + 1];
11
for (int i = 0; i <= maxsize; i++)
13
inusemap[i] = new SimpleObjectPool();
14
notusemap[i] = new SimpleObjectPool();
18
public byte[][] allocByte(int size)
20
// For now until the bug can be removed
21
return new byte[size][0];
24
return new byte[size][0];
26
ObjectPool not_usel = notusemap[size];
27
ObjectPool in_usel = inusemap[size];
31
if (!not_usel.isEmpty()) {
32
Object o = not_usel.remove();
35
b = new byte[size][0];
41
public void release(byte[][] b)
43
if (b.length > maxsize)
47
ObjectPool not_usel = notusemap[b.length];
48
ObjectPool in_usel = inusemap[b.length];
55
* Deallocate the object cache.
56
* PM 17/01/01: Commented out this code as it blows away any hope of
57
* multiple queries on the same connection. I'll redesign the allocation
58
* code to use some form of Statement context, so the buffers are per
59
* Statement and not per Connection/PG_Stream as it is now.
61
public void deallocate()
63
//for(int i = 0; i <= maxsize; i++){
64
// notusemap[i].addAll(inusemap[i]);
65
// inusemap[i].clear();