Revision: 3963
http://bigdata.svn.sourceforge.net/bigdata/?rev=3963&view=rev
Author: thompsonbry
Date: 2010-11-18 17:49:36 +0000 (Thu, 18 Nov 2010)
Log Message:
-----------
Added trap for non-positive sizes on alloc.
Modified Paths:
--------------
branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java
Modified: branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java
===================================================================
--- branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java 2010-11-18 17:44:52 UTC (rev 3962)
+++ branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/FixedAllocator.java 2010-11-18 17:49:36 UTC (rev 3963)
@@ -461,8 +461,13 @@
* must therefore handle the
*/
public int alloc(final RWStore store, final int size, final IAllocationContext context) {
- int addr = -1;
+ if (size <= 0)
+ throw new IllegalArgumentException(
+ "Allocate requires positive size, got: " + size);
+
+ int addr = -1;
+
final Iterator<AllocBlock> iter = m_allocBlocks.iterator();
int count = -1;
while (addr == -1 && iter.hasNext()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|