+------------+------------+------------+------------+ - - -
| header | data[0] | data[1] | data[2] |
+------------+------------+------------+------------+ - - -
^
pointer
(The real data part can be all kinds of things including stuff opaque to the GC like strings).I'm still a bit unconvinced that swapping the sense of pointers vs ints is useful for OCaml, as it would be a massive change with no current evidence base. It seems better to me to work on better compiler optimizations so that integers can be kept in registers with their true value more often.
In SBCL, this also allows cons cells to have their own offset, so car and cdr are implemented with one instruction and are safe (that is, throw an exception if applied to something they don't work on) even in code compiled at (safety 0).
Now just waiting for parallel GC in SBCL. ;) Well, also waiting for some other things, I will admit.
It is? By default x86 will happily do unaligned accesses, and I'm pretty sure SBCL doesn't change that. Not sure about other instruction sets.
SBCL also uses double-word alignment and 4-bit tags, so you could CDR (expecting lowtag #b0111) a structure object (lowtag #b1111).