|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectweb.jonathan.libs.resources.JChunkFactory
public class JChunkFactory
A Chunk Factory implementation.
A chunk factory creates and manages chunks. This chunk factory manages two pools of chunks of different sizes, so that a released chunk may be reused in a different context, saving the time for allocating and collecting the associated memory. The sizes of the chunks used, and of the preallocated pools may be changed.
| Field Summary | |
|---|---|
boolean |
verbose
Indicates whether warning message should be printed to stderr. |
| Constructor Summary | |
|---|---|
JChunkFactory()
Returns a new chunk factory |
|
JChunkFactory(int big_pool_size,
int big_size,
int small_pool_size,
int small_size,
boolean verbose)
Returns a new chunk factory |
|
| Method Summary | |
|---|---|
Chunk |
newChunk()
Returns a chunk of a default (small) size. |
Chunk |
newChunk(int size)
Returns a chunk of (at least) the specified size. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public boolean verbose
In particular, if verbose is true, and if all the chunks in a pool are used, a warning will be emitted. This may be useful to tune the pool sizes.
This value is defined under the name "/jonathan/JChunkFactory/verbose"
in the bootstrap context.
| Constructor Detail |
|---|
public JChunkFactory()
public JChunkFactory(int big_pool_size,
int big_size,
int small_pool_size,
int small_size,
boolean verbose)
big_pool_size - size of the big chunks poolbig_size - size of the big chunkssmall_pool_size - size of the small chunks poolsmall_size - size of the small chunksverbose - indicates whether warning messages should be printed to
stderr.verbose| Method Detail |
|---|
public Chunk newChunk()
newChunk in interface ChunkFactorypublic Chunk newChunk(int size)
This method may return a larger chunk than expected.
newChunk in interface ChunkFactorysize - the expected size of the chunk.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||