diff src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp @ 269:850fdf70db2b

Merge
author jmasa
date Mon, 28 Jul 2008 15:30:23 -0700
parents d1605aabd0a1 12eea04c8b06
children e018e6884bd8
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp	Fri Jul 25 11:29:03 2008 -0700
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp	Mon Jul 28 15:30:23 2008 -0700
@@ -71,8 +71,15 @@
 TreeList* TreeList::as_TreeList(HeapWord* addr, size_t size) {
   TreeChunk* tc = (TreeChunk*) addr;
   assert(size >= sizeof(TreeChunk), "Chunk is too small for a TreeChunk");
-  assert(tc->size() == 0 && tc->prev() == NULL && tc->next() == NULL,
-    "Space should be clear");
+  // The space in the heap will have been mangled initially but
+  // is not remangled when a free chunk is returned to the free list
+  // (since it is used to maintain the chunk on the free list).
+  assert((ZapUnusedHeapArea &&
+          SpaceMangler::is_mangled((HeapWord*) tc->size_addr()) &&
+          SpaceMangler::is_mangled((HeapWord*) tc->prev_addr()) &&
+          SpaceMangler::is_mangled((HeapWord*) tc->next_addr())) ||
+          (tc->size() == 0 && tc->prev() == NULL && tc->next() == NULL),
+    "Space should be clear or mangled");
   tc->setSize(size);
   tc->linkPrev(NULL);
   tc->linkNext(NULL);