< prev index next >

src/share/vm/memory/allocation.cpp

Print this page




 773       if (c->next() == NULL) {
 774         top = hwm2;     // last junk is only used up to hwm2
 775         assert(c->contains(hwm2), "bad hwm2");
 776       }
 777       free_all((char**)c->bottom(), (char**)top);
 778     }
 779     assert(chunk->contains(hwm), "bad hwm");
 780     assert(chunk->contains(max), "bad max");
 781     free_all((char**)hwm, (char**)max);
 782   } else {
 783     // this chunk was partially used
 784     assert(chunk->contains(hwm), "bad hwm");
 785     assert(chunk->contains(hwm2), "bad hwm2");
 786     free_all((char**)hwm, (char**)hwm2);
 787   }
 788 }
 789 
 790 
 791 ReallocMark::ReallocMark() {
 792 #ifdef ASSERT
 793   Thread *thread = ThreadLocalStorage::get_thread_slow();
 794   _nesting = thread->resource_area()->nesting();
 795 #endif
 796 }
 797 
 798 void ReallocMark::check() {
 799 #ifdef ASSERT
 800   if (_nesting != Thread::current()->resource_area()->nesting()) {
 801     fatal("allocation bug: array could grow within nested ResourceMark");
 802   }
 803 #endif
 804 }
 805 
 806 #endif // Non-product


 773       if (c->next() == NULL) {
 774         top = hwm2;     // last junk is only used up to hwm2
 775         assert(c->contains(hwm2), "bad hwm2");
 776       }
 777       free_all((char**)c->bottom(), (char**)top);
 778     }
 779     assert(chunk->contains(hwm), "bad hwm");
 780     assert(chunk->contains(max), "bad max");
 781     free_all((char**)hwm, (char**)max);
 782   } else {
 783     // this chunk was partially used
 784     assert(chunk->contains(hwm), "bad hwm");
 785     assert(chunk->contains(hwm2), "bad hwm2");
 786     free_all((char**)hwm, (char**)hwm2);
 787   }
 788 }
 789 
 790 
 791 ReallocMark::ReallocMark() {
 792 #ifdef ASSERT
 793   Thread *thread = Thread::current();
 794   _nesting = thread->resource_area()->nesting();
 795 #endif
 796 }
 797 
 798 void ReallocMark::check() {
 799 #ifdef ASSERT
 800   if (_nesting != Thread::current()->resource_area()->nesting()) {
 801     fatal("allocation bug: array could grow within nested ResourceMark");
 802   }
 803 #endif
 804 }
 805 
 806 #endif // Non-product
< prev index next >