carld / micro-lisp

🎄A very small Lisp programming language 😀that used to be under 200 lines of C🎄
MIT License
798 stars 69 forks source link

Alignment & pointer tagging discussion in blog post #1

Closed mtnygard closed 6 years ago

mtnygard commented 6 years ago

to an 8-bit boundary, it means that when memory is allocated it’s address will be a multiple of 8. For example the next 8 bit boundary for the address 0x100200230 is 0x100200238

Shouldn't this be talking about 8-byte alignment rather than 8-bit alignment? 8 bytes is the 64-bit word size that C compilers use these days.

carld commented 6 years ago

Hey @mtnygard thanks for your comment, you are right, that example is an 8 byte memory boundary. I got bits and bytes mixed up there.

ghost commented 6 years ago

The source should IMHO use an extra field for tagging. There is simply no reason to ask for trouble like that, likely to reduce portability.