[jboss-cvs] JBoss Messaging SVN: r4920 - trunk/src/main/org/jboss/messaging/core/journal/impl.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Sep 8 12:06:48 EDT 2008
Author: clebert.suconic at jboss.com
Date: 2008-09-08 12:06:47 -0400 (Mon, 08 Sep 2008)
New Revision: 4920
Modified:
trunk/src/main/org/jboss/messaging/core/journal/impl/JournalImpl.java
Log:
appendPrepare should be using the method newBuffer to allocate the buffer, in order to reuse buffers.
Modified: trunk/src/main/org/jboss/messaging/core/journal/impl/JournalImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/journal/impl/JournalImpl.java 2008-09-08 14:36:12 UTC (rev 4919)
+++ trunk/src/main/org/jboss/messaging/core/journal/impl/JournalImpl.java 2008-09-08 16:06:47 UTC (rev 4920)
@@ -1605,7 +1605,7 @@
int xidSize = xid.getEncodeSize();
int size = SIZE_COMPLETE_TRANSACTION_RECORD + tx.getElementsSummary().size() * SIZE_INT * 2 + xidSize + SIZE_INT;
- ByteBuffer bb = fileFactory.newBuffer(size);
+ ByteBuffer bb = newBuffer(size);
bb.put(recordType);
bb.position(SIZE_BYTE + SIZE_INT); // skip ID part
@@ -1987,7 +1987,7 @@
reuseBuffers.clear();
}
- if (reuseBufferSize <= 0 || size > reuseBufferSize)
+ if (size > reuseBufferSize)
{
return fileFactory.newBuffer(size);
}
More information about the jboss-cvs-commits
mailing list