logoalt Hacker News

saagarjhayesterday at 11:26 AM1 replyview on HN

The same reason you probably aren’t adding manual alignment fixes to your code?


Replies

matheusmoreirayesterday at 11:44 AM

No reason at all, then. Because I am manually dealing with alignment in my code.

Wrote a lisp, its bytes type supports reading and writing integers at arbitrary locations within the buffer. Test suite exercises aligned and unaligned memory access for every C integer type. Also wrote my own mem* functions, dealing with alignment in those was certainly a fun exercise. It wasn't necessary, I just wanted the performance benefits.