new pragma: 'noinit'

This commit is contained in:
Araq
2011-11-25 15:33:58 +01:00
parent ed9c7761c4
commit 2de98d9e05
6 changed files with 34 additions and 17 deletions

View File

@@ -1526,6 +1526,14 @@ T = enum cast[T](0); this may be an invalid value
============================ ==============================================
The implicit initialization can be avoided for optimization reasons with the
`noinit`:idx: pragma:
.. code-block:: nimrod
var
a {.noInit.}: array [0..1023, char]
Const section
~~~~~~~~~~~~~
@@ -1781,6 +1789,7 @@ sugar for:
result = expr
return result
``return`` without an expression is a short notation for ``return result`` if
the proc has a return type. The `result`:idx: variable is always the return
value of the procedure. It is automatically declared by the compiler. As all