harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arc...@apache.org
Subject svn commit: r378950 - /incubator/harmony/enhanced/jchevm/libjc/heap.c
Date Sun, 19 Feb 2006 20:12:54 GMT
Author: archie
Date: Sun Feb 19 12:12:53 2006
New Revision: 378950

URL: http://svn.apache.org/viewcvs?rev=378950&view=rev
Log:
Add some commentry.

Modified:
    incubator/harmony/enhanced/jchevm/libjc/heap.c

Modified: incubator/harmony/enhanced/jchevm/libjc/heap.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/jchevm/libjc/heap.c?rev=378950&r1=378949&r2=378950&view=diff
==============================================================================
--- incubator/harmony/enhanced/jchevm/libjc/heap.c (original)
+++ incubator/harmony/enhanced/jchevm/libjc/heap.c Sun Feb 19 12:12:53 2006
@@ -28,6 +28,22 @@
 static int	_jc_heap_roundup_block_size(_jc_jvm *vm, int size, int *nbp);
 
 /*
+ * The heap is one big memory region divided into VM pages. Pages are either
+ * free, small, or large. Small pages are divided up into two or more blocks
+ * of equal size. Large pages are used for large objects that require more
+ * than half a page. All pages except "interior" large pages (i.e., large pages
+ * that are not the first in their object) have a descriptor word at the start
+ * indicating what type of page it is.
+ *
+ * Since object headers are not necessarily at the beginning of an object's
+ * memory (when the object has reference fields), if doing so would not bump
+ * an object up to the next block size, or if required for alignment, then a
+ * "skip word" is prepended to the object. The skip word contains the number
+ * of references in the object, and by being at the start of the object's
+ * memory allows finding the head of the object in constant time.
+ */
+
+/*
  * Initialize a VM's heap.
  *
  * If unsuccessful an exception is stored.



Mime
View raw message