Created
February 12, 2023 17:33
-
-
Save metarsit/88974ac349be7180de2f7364073946d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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