summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-08-09 20:57:10 +0200
committerSven Gothel <[email protected]>2011-08-09 20:57:10 +0200
commit5a80d1c62159402efe10a645445e6487b8bc989d (patch)
tree2a4bf8e98c8a6fca2ff4012bc3c21f114654e92f /src/java/com/jogamp/common
parent90ff6c401934121395fa4a127e8b889106fda07a (diff)
CachedBufferFactory: Cosmetic changes - comments, -1 -> 0
Diffstat (limited to 'src/java/com/jogamp/common')
-rw-r--r--src/java/com/jogamp/common/nio/CachedBufferFactory.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/java/com/jogamp/common/nio/CachedBufferFactory.java b/src/java/com/jogamp/common/nio/CachedBufferFactory.java
index dbeed2d..b9d75db 100644
--- a/src/java/com/jogamp/common/nio/CachedBufferFactory.java
+++ b/src/java/com/jogamp/common/nio/CachedBufferFactory.java
@@ -153,18 +153,27 @@ public class CachedBufferFactory {
/**
* Returns the allocation size used to create new internal buffers.
- * This represents the initial size if {@link #isFixed()} == true.
+ * 0 means that the buffer will not grows, see {@link #isFixed()}.
*/
public int getAllocationSize() {
return ALLOCATION_SIZE;
}
+ /**
+ * @return true if buffer cannot grow, otherwise false
+ */
private void checkIfFixed() {
- if(ALLOCATION_SIZE == -1) {
+ if(ALLOCATION_SIZE == 0) {
throw new RuntimeException("fixed size buffer factory ran out ouf bounds.");
}
}
+ public void destroy() {
+ if(null != currentBuffer) {
+ currentBuffer.clear();
+ currentBuffer = null;
+ }
+ }
public ByteBuffer newDirectByteBuffer(int size) {
// if large enough... just create it