Skip to content

Instantly share code, notes, and snippets.

@CodeSandwich
Created March 26, 2018 12:38
Show Gist options
  • Save CodeSandwich/71bc41aac764d62482c6f9ae1cc3c675 to your computer and use it in GitHub Desktop.
Save CodeSandwich/71bc41aac764d62482c6f9ae1cc3c675 to your computer and use it in GitHub Desktop.
main {
A = allocate() // acquire
do_stuff(A) // use
release(A) // release, pointer owns allocation
// delete pointer
}
do_stuff(B) {
do_more_stuff(B) // use
// don't release, pointer doesn't own allocation
// delete pointer
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment