diff options
author | Araq <rumpf_a@web.de> | 2015-08-04 17:31:00 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-08-04 17:31:18 +0200 |
commit | ab26298a035ed794fc73724a6ae06eefd6c764d3 (patch) | |
tree | 92eabb800ac80655ec3036633f8bbe519fe94060 /lib | |
parent | f8f967720598ad75ec0e0db68a983cbcdd39145d (diff) | |
download | Nim-ab26298a035ed794fc73724a6ae06eefd6c764d3.tar.gz |
added system.unsafeAddr
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.nim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index 93d76e78b..e5cae1336 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -153,6 +153,13 @@ proc `addr`*[T](x: var T): ptr T {.magic: "Addr", noSideEffect.} = ## Cannot be overloaded. discard +proc unsafeAddr*[T](x: var T): ptr T {.magic: "Addr", noSideEffect.} = + ## Builtin 'addr' operator for taking the address of a memory location. + ## This works even for ``let`` variables or parameters for better interop + ## with C and so it is considered even more unsafe than the ordinary ``addr``. + ## Cannot be overloaded. + discard + proc `type`*(x: expr): typeDesc {.magic: "TypeOf", noSideEffect.} = ## Builtin 'type' operator for accessing the type of an expression. ## Cannot be overloaded. |