summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorCharles Blake <cblake@csail.mit.edu>2015-08-04 16:13:45 -0400
committerCharles Blake <cblake@csail.mit.edu>2015-08-04 16:13:45 -0400
commit26f7a53d4a526b6305a2bca3d28c3c5eb9cfa297 (patch)
tree2cf1aa123e06d32a37caa0ce2c3f079d5b2393ac /lib
parent5ec4b7946fd8c916ac0cf0d94b42837a571adc68 (diff)
parent096ce55c1a50ad2f8ae43e4928218b85fb5d3d20 (diff)
downloadNim-26f7a53d4a526b6305a2bca3d28c3c5eb9cfa297.tar.gz
Merge ../Nim into devel
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim7
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.