1.1 --- a/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp Sat Jan 09 09:01:41 2010 -0800 1.2 +++ b/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp Tue Jan 12 14:56:46 2010 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -27,8 +27,13 @@ 1.11 HeapWord* obj = top(); 1.12 if (pointer_delta(end(), obj) >= size) { 1.13 // successful thread-local allocation 1.14 - 1.15 - DEBUG_ONLY(Copy::fill_to_words(obj, size, badHeapWordVal)); 1.16 +#ifdef ASSERT 1.17 + // Skip mangling the space corresponding to the object header to 1.18 + // ensure that the returned space is not considered parsable by 1.19 + // any concurrent GC thread. 1.20 + size_t hdr_size = CollectedHeap::min_fill_size(); 1.21 + Copy::fill_to_words(obj + hdr_size, size - hdr_size, badHeapWordVal); 1.22 +#endif // ASSERT 1.23 // This addition is safe because we know that top is 1.24 // at least size below end, so the add can't wrap. 1.25 set_top(obj + size);