comparison src/share/vm/memory/metablock.cpp @ 8712:3efdfd6ddbf2

8003553: NPG: metaspace objects should be zeroed in constructors Summary: Zero metadata in constructors, not in allocation (and some in constructors) Reviewed-by: jmasa, sspitsyn
author coleenp
date Fri, 08 Mar 2013 11:47:57 -0500
parents eade6b2e4782
children 5939f5953b45
comparison
equal deleted inserted replaced
8711:6b803ba47588 8712:3efdfd6ddbf2
1 /* 1 /*
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
63 if (p == NULL) { 63 if (p == NULL) {
64 return NULL; 64 return NULL;
65 } 65 }
66 66
67 Metablock* result = (Metablock*) p; 67 Metablock* result = (Metablock*) p;
68
69 // Clear the memory
70 Copy::fill_to_aligned_words((HeapWord*)result, word_size);
71 #ifdef ASSERT 68 #ifdef ASSERT
69 // Add just to catch missing initializations
70 Copy::fill_to_words((HeapWord*) result, word_size, 0xf1f1f1f1);
72 result->set_word_size(word_size); 71 result->set_word_size(word_size);
73 #endif 72 #endif
74 return result; 73 return result;
75 } 74 }