Hacking Go's Garbage Collector: Pointer Stores from Assembly

This post delves into the intricacies of manipulating Go pointers from assembly code, focusing on the crucial interaction with Go's garbage collector. Directly manipulating pointers requires explicitly informing the GC via functions like `runtime.gcWriteBarrier2` and `runtime.writeBarrier` to avoid conflicts and potential crashes. The article also tackles the challenge of allocating 128-bit aligned memory for optimal AVX instruction usage, presenting a clever workaround. However, it warns against relying on internal runtime functions, as their availability might change in future Go versions.
Read more