You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by be...@apache.org on 2015/02/11 17:07:52 UTC
[2/5] cassandra git commit: Throw OOM if allocating memory fails to
return a valid pointer
Throw OOM if allocating memory fails to return a valid pointer
patch by benedict; reviewed by jbellis for CASSANDRA-8726
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a72869c7
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a72869c7
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a72869c7
Branch: refs/heads/trunk
Commit: a72869c7f01d7be7b3535a6f4dd673b085a4d71e
Parents: 6ae8ada
Author: Benedict Elliott Smith <be...@apache.org>
Authored: Wed Feb 11 16:06:11 2015 +0000
Committer: Benedict Elliott Smith <be...@apache.org>
Committed: Wed Feb 11 16:06:11 2015 +0000
----------------------------------------------------------------------
CHANGES.txt | 1 +
src/java/org/apache/cassandra/io/util/Memory.java | 2 ++
2 files changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/a72869c7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 7fa5f63..d2ecccc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
2.0.13:
+ * Throw OOM if allocating memory fails to return a valid pointer (CASSANDRA-8726)
* Fix SSTableSimpleUnsortedWriter ConcurrentModificationException (CASSANDRA-8619)
* Round up time deltas lower than 1ms in BulkLoader (CASSANDRA-8645)
* Add batch remove iterator to ABSC (CASSANDRA-8414, 8666)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/a72869c7/src/java/org/apache/cassandra/io/util/Memory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/Memory.java b/src/java/org/apache/cassandra/io/util/Memory.java
index 263205b..fb70b99 100644
--- a/src/java/org/apache/cassandra/io/util/Memory.java
+++ b/src/java/org/apache/cassandra/io/util/Memory.java
@@ -49,6 +49,8 @@ public class Memory
{
size = bytes;
peer = allocator.allocate(size);
+ if (size != 0 && peer == 0)
+ throw new OutOfMemoryError();
}
public static Memory allocate(long bytes)