OSDN Git Service

Address comments on change 45d26c86b00580593067ca42091ad66cf7dc4f7c
authorBrian Carlstrom <bdc@google.com>
Wed, 25 Jun 2014 16:30:52 +0000 (09:30 -0700)
committerBrian Carlstrom <bdc@google.com>
Wed, 25 Jun 2014 16:30:56 +0000 (09:30 -0700)
Change-Id: Ibb559ae41654660064f4a8df71274c4e4f16807a

runtime/jni_internal.cc
runtime/jni_internal_test.cc

index 2fadfb0..8842f59 100644 (file)
@@ -2454,7 +2454,7 @@ class JNI {
       return nullptr;
     }
 
-    // At the moment, the capacity is limited to a jint (31 bits).
+    // At the moment, the capacity of DirectByteBuffer is limited to a signed int.
     if (capacity > INT_MAX) {
       JniAbortF("NewDirectByteBuffer", "buffer capacity greater than maximum jint: %" PRId64, capacity);
       return nullptr;
index 218ae95..a933f86 100644 (file)
@@ -1518,7 +1518,7 @@ TEST_F(JniInternalTest, NewDirectBuffer_GetDirectBufferAddress_GetDirectBufferCa
 
   {
     CheckJniAbortCatcher check_jni_abort_catcher;
-    env_->NewDirectByteBuffer(bytes, static_cast<jlong>(INT_MAX) * 2);
+    env_->NewDirectByteBuffer(bytes, static_cast<jlong>(INT_MAX) + 1);
     check_jni_abort_catcher.Check("in call to NewDirectByteBuffer");
   }
 }