Created
December 3, 2011 23:53
-
-
Save zah/1428545 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
| proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} = | |
| assertAllocatedPtr(src) | |
| dest[] = src | |
| proc asgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} = | |
| dest[] = src | |
| assertAllocatedPtr(src) | |
| proc asgnRefNoCycle(dest: ppointer, src: pointer) {.compilerproc, inline.} = | |
| dest[] = src | |
| assertAllocatedPtr(src) | |
| ........ | |
| proc assertAllocatedPtr(p: pointer) {.compilerRtl, noinline.} = | |
| var c = usrToCell(p) | |
| sysAssert(isAllocatedPtr(gch.region, c), "bad GC pointer") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment