gencgc: Fix commentary for page table allocation field.
authorAlastair Bridgewater <alastair.bridgewater@gmail.com>
Sun, 12 May 2013 15:43:09 +0000 (11:43 -0400)
committerAlastair Bridgewater <nyef@kana.lisphacker.com>
Mon, 20 May 2013 19:51:20 +0000 (15:51 -0400)
  * The commentary for the page table allocation field was
misleading, presumably not updated when the definitions for the
constants used for its actual contents were last changed, and cost
me a bit of surprise and time spent trying to figure out why core
file saving and loading worked at all.

  * Updated the commentary on the allocation field to match
current reality, and added cross-references between the field
itself and the definitions for its contents, so that a future
desync between commentary and reality is less likely.

src/runtime/gc-internal.h
src/runtime/gencgc-internal.h

index c23febf..b916396 100644 (file)
@@ -79,7 +79,9 @@ NWORDS(uword_t x, uword_t n_bits)
 #define FUN_RAW_ADDR_OFFSET (offsetof(struct simple_fun, code) - FUN_POINTER_LOWTAG)
 #endif
 
-/* values for the *_alloc_* parameters */
+/* values for the *_alloc_* parameters, also see the commentary for
+ * struct page in gencgc-internal.h.  FIXME: Perhaps these constants
+ * should be there, or at least defined on gencgc only? */
 #define FREE_PAGE_FLAG 0
 #define BOXED_PAGE_FLAG 1
 #define UNBOXED_PAGE_FLAG 2
index ef4bdaa..bbffe83 100644 (file)
@@ -75,10 +75,13 @@ struct page {
          * written during a GC. */
         write_protected_cleared :1,
         /*  000 free
-         *  10? boxed data
-         *  11? boxed code
-         *  01? unboxed data
-         *  ??1 open region
+         *  ?01 boxed data
+         *  ?10 unboxed data
+         *  ?11 code
+         *  1?? open region
+         *
+         * Constants for this field are defined in gc-internal.h, the
+         * xxx_PAGE_FLAG definitions.
          *
          * If the page is free the following slots are invalid, except
          * for the bytes_used which must be zero. */