Skip to content

Instantly share code, notes, and snippets.

@metarsit
Created February 12, 2023 17:33
Show Gist options
  • Select an option

  • Save metarsit/88974ac349be7180de2f7364073946d4 to your computer and use it in GitHub Desktop.

Select an option

Save metarsit/88974ac349be7180de2f7364073946d4 to your computer and use it in GitHub Desktop.
package main
import (
"arena"
)
func main() {
mem := arena.NewArena()
i := arena.New[int](mem)
mem.Free() // Free the arena memory
// Accessing the value after free may result in a fault,
// but this fault is also not guaranteed.
*i = 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment