< prev index next >

src/share/vm/gc_implementation/g1/ptrQueue.cpp

Print this page
rev 7793 : 8073315: Enable gcc -Wtype-limits and fix upcoming issues.

@@ -56,21 +56,21 @@
   }
 }
 
 
 void PtrQueue::enqueue_known_active(void* ptr) {
-  assert(0 <= _index && _index <= _sz, "Invariant.");
+  assert(_index <= _sz, "Invariant.");
   assert(_index == 0 || _buf != NULL, "invariant");
 
   while (_index == 0) {
     handle_zero_index();
   }
 
   assert(_index > 0, "postcondition");
   _index -= oopSize;
   _buf[byte_index_to_index((int)_index)] = ptr;
-  assert(0 <= _index && _index <= _sz, "Invariant.");
+  assert(_index <= _sz, "Invariant.");
 }
 
 void PtrQueue::locking_enqueue_completed_buffer(void** buf) {
   assert(_lock->owned_by_self(), "Required.");
 

@@ -192,11 +192,11 @@
   }
   // Reallocate the buffer
   _buf = qset()->allocate_buffer();
   _sz = qset()->buffer_size();
   _index = _sz;
-  assert(0 <= _index && _index <= _sz, "Invariant.");
+  assert(_index <= _sz, "Invariant.");
 }
 
 bool PtrQueueSet::process_or_enqueue_complete_buffer(void** buf) {
   if (Thread::current()->is_Java_thread()) {
     // We don't lock. It is fine to be epsilon-precise here.
< prev index next >