harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arc...@apache.org
Subject svn commit: r357078 - /incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/heap.c
Date Thu, 15 Dec 2005 22:05:30 GMT
Author: archie
Date: Thu Dec 15 14:05:28 2005
New Revision: 357078

URL: http://svn.apache.org/viewcvs?rev=357078&view=rev
Log:
Add a couple more assertions to the heap checking debug code.

Modified:
    incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/heap.c

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/heap.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/heap.c?rev=357078&r1=357077&r2=357078&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/heap.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/jchevm/jchevm/libjc/heap.c Thu Dec 15
14:05:28 2005
@@ -15,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  *
- * $Id: heap.c,v 1.9 2005/03/05 23:59:08 archiecobbs Exp $
+ * $Id$
  */
 
 #include "libjc.h"
@@ -706,6 +706,12 @@
 	if (_JC_LW_TEST(obj->lockword, ARRAY)) {
 		_JC_ASSERT((type->u.array.element_type->flags & _JC_TYPE_MASK)
 		    == _JC_LW_EXTRACT(obj->lockword, TYPE));
+		_JC_ASSERT(_jc_num_refs(obj) == ((_jc_array *)obj)->length
+		    * (_JC_LW_EXTRACT(obj->lockword, TYPE)
+		      == _JC_TYPE_REFERENCE));
+	} else {
+		_JC_ASSERT(_jc_num_refs(obj)
+		    == obj->type->u.nonarray.num_virtual_refs);
 	}
 
 	/* Recurse (once) on reference fields */



Mime
View raw message