Revise some outdated comments

This commit is contained in:
Douglas Katzman 2026-09-06 04:39:29 +00:00
parent 790814f16e
commit 7aadac2648
3 changed files with 32 additions and 8 deletions

View file

@ -438,12 +438,37 @@
;;; There are 2 symbol flag bits. The placement restrictions on these stipulate:
;;; - no conflict with the generation number (byte 3, low 4 bits)
;;; - avoid #+permgen use of byte 3 bit 7 as the "remembered" bit
;;; - prefer that the uint16_t package ID be naturally aligned if it matters.
;;; Given the above:
;;; - for x864: byte indices 1 and 2 for the package, byte index 3 for flags so that
;;; the generation byte can stay where it is
;;; - for others: byte indices 2 and 3 for package, byte index 1 for flags.
;;; The reason for a discrepancy between x86-64 and everybody else is that
;;; x86-64 has no penalty for unaligned access, whereas we assume otherwise
;;; that it is required (or preferred) to use a naturally-aligned uint16_t.
;;;
;;; A picture is worth a thousand words:
;;;
;;; byte 3 | bytes 1,2 | byte 0 |
;;; +-----+-----+-----+-----+-----+------------+------------+---------+ #+x86-64
;;; | | | | | | 2 byte | |
;;; | R | f | f | V | - | generation | package-id | widetag |
;;; | | | | | (3 bits) | | |
;;; +-----+-----+-----+-----+-----+------------+------------+---------+
;;;
;;; bytes 2,3 | byte 1 | byte 0 |
;;; +---------------------+-----+-----+----------+---------+ #-x86-64
;;; | 2 byte | | | | |
;;; | package-id | f | f | 6 unused | widetag |
;;; | | | | bits | |
;;; +---------------------|-----+-----+----------+---------+
;;;
;;; - = unused
;;; V = "Visited" bit for mark-and-sweep collector
;;; R = "Remset" presence bit
;;; f = flag bits
;;; A symbol that is "fast bindable" is neither constant, nor global,
;;; nor a global symbol-macro, nor in a locked package. Such symbols can be
;;; bound by PROGV without calling ABOUT-TO-MODIFY-SYMBOL-VALUE, except in the

View file

@ -145,14 +145,13 @@ Code header representation:
+---------------------------------+
max total payload size in words = #x3fffff
| total words | gc_gen | 0 | 0 | widetag |
| (4 bytes) | | | | |
| total words | gc_gen | 0 | TLSF | widetag |
| (4 bytes) | | | bits | |
+------------------------------------------------------------+ [64-bit words]
| | N boxed header bytes |
| | (4 bytes) |
+------------------------------------------------------------+
the two zero bytes are reserved for future use
max total payload size in words = uint_max
(should probably made the same as for 32-bit word size for consistency)

View file

@ -120,14 +120,14 @@ typedef struct block_header_t {
unsigned char widetag;
unsigned char _flags; // must have at most bits 0, 1, 2 on
unsigned char unused; // must be zero
unsigned char gen; // low 4 must be 0..5 and bit 0x4 can be on
unsigned char gen; // low 4 must be 0..6 and bit index 4 (VISITED) can be on
uint32_t _nwords; // including the header
#else
// For this word to read as an object header, the size and widetag
// are flipped relative to little-endian.
// I did not actually test this - I am merely guessing that it's right.
uint32_t _nwords; // including the header
unsigned char gen; // low 4 must be 0..5 and bit 0x4 can be on
unsigned char gen; // low 4 must be 0..6 and bit index 4 (VISITED) can be on
unsigned char unused; // must be zero
unsigned char _flags; // must have at most bits 0, 1, 2 on
unsigned char widetag;