From 379e3d3ee80c6b9dd9c59f8f76baa6d47c8c5b71 Mon Sep 17 00:00:00 2001 From: Alastair Bridgewater Date: Sun, 12 May 2013 11:43:09 -0400 Subject: [PATCH] gencgc: Fix commentary for page table allocation field. * 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 | 4 +++- src/runtime/gencgc-internal.h | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/runtime/gc-internal.h b/src/runtime/gc-internal.h index c23febf..b916396 100644 --- a/src/runtime/gc-internal.h +++ b/src/runtime/gc-internal.h @@ -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 diff --git a/src/runtime/gencgc-internal.h b/src/runtime/gencgc-internal.h index ef4bdaa..bbffe83 100644 --- a/src/runtime/gencgc-internal.h +++ b/src/runtime/gencgc-internal.h @@ -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. */ -- 1.7.10.4