summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/system.nim5
-rw-r--r--web/news.txt3
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 869658727..5e27bd83a 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -185,6 +185,8 @@ proc `..`*[T](b: T): TSlice[T] {.noSideEffect, inline.} =
 
 when not defined(niminheritable):
   {.pragma: inheritable.}
+when not defined(nimunion):
+  {.pragma: unchecked.}
 
 const NoFakeVars* = defined(NimrodVM) ## true if the backend doesn't support \
   ## "fake variables" like 'var EBADF {.importc.}: cint'.
@@ -194,9 +196,10 @@ when not defined(JS):
     TGenericSeq {.compilerproc, pure, inheritable.} = object
       len, reserved: int
     PGenericSeq {.exportc.} = ptr TGenericSeq
+    UncheckedCharArray {.unchecked.} = array[0..100_000_000, char]
     # len and space without counting the terminating zero:
     NimStringDesc {.compilerproc, final.} = object of TGenericSeq
-      data: array[0..100_000_000, char]
+      data: UncheckedCharArray
     NimString = ptr NimStringDesc
 
 when not defined(JS) and not defined(NimrodVM):
diff --git a/web/news.txt b/web/news.txt
index f9ac1b66d..0001cece7 100644
--- a/web/news.txt
+++ b/web/news.txt
@@ -60,6 +60,9 @@ News
       virtual machine. This fixes numerous bugs for ``nimrod i`` and for macro
       evaluation.
     - ``--gc:none`` produces warnings when code uses the GC.
+    - A ``union`` pragma for better C interoperability is now supported.
+    - Arrays can be annotated to be ``unchecked`` for easier low level
+      manipulations of memory.
 
 
     Language Additions