News for hackers. Stuff that matters.
Re:Golang's Big Miss on Memory Arenas by zbentley on Thursday December 11, 2025 @09:44AM (#46231985)
Types with inner pointers add difficulty to be sure, but it’s still possible to use them with this pattern. You have to make sure of three things to do so: 1) no pointers outside of the backing memory; 2) an explicit “clear()” function that manually nulls out inner pointers in the stored object (even inner pointers to other things in the backing slice); 3) clear() is called for all such objects that were ever stored before the backing slice is dropped and before those objects are garbage collected.

There are no comments on this comment yet.