News for hackers. Stuff that matters.
Re:Eliminating Go bounds checks with unsafe by ncruces on Monday July 20, 2026 @07:52AM (#48977491)
The article should note this: it's important that you don't go adding other/all little endian platforms to that go:build line.

The article is correct, but this code is only valid for platforms that allow unaligned access.

You can get the full list of platforms that Go considers safe for this from unalignedOK here: https://go.dev/src/cmd/compile/internal/ssa/config.go

You want the intersection of unalignedOK with little endian.

Re:Eliminating Go bounds checks with unsafe by molecularman on Wednesday July 22, 2026 @01:21AM (#49002184)
Thank you. I've added your comment to the essay.