cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject [2/5] cassandra git commit: Throw OOM if allocating memory fails to return a valid pointer
Date Wed, 11 Feb 2015 16:07:52 GMT
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 <benedict@apache.org>
Authored: Wed Feb 11 16:06:11 2015 +0000
Committer: Benedict Elliott Smith <benedict@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)


Mime
View raw message