diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2014-03-21 23:52:30 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2014-03-21 23:52:30 +0100 |
commit | 13d26dc53db455ef07feb315871a7fceee5f7a01 (patch) | |
tree | a09abef13ae7b81101d1e77be0f6a989453d3e73 | |
parent | 4f91dd40ed78ece0c41a63ad27e10127098e1d2b (diff) | |
parent | 2a182f55aeb22149d72f7f3e2e0c96019b8dcd17 (diff) | |
download | Nim-13d26dc53db455ef07feb315871a7fceee5f7a01.tar.gz |
Merge pull request #1021 from skyfex/devel
Added documentation for packed pragma
-rw-r--r-- | doc/manual.txt | 10 | ||||
-rw-r--r-- | web/news.txt | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/doc/manual.txt b/doc/manual.txt index ab1badaf3..c4b08a942 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -5390,6 +5390,16 @@ checked. **Future directions**: GC'ed memory should be allowed in unions and the GC should scan unions conservatively. +Packed pragma +------------- +The `packed`:idx: pragma can be applied to any ``object`` type. It ensures +that the fields of an object are packed back-to-back in memory. It is useful +to store packets or messages from/to network or hardware drivers, and for +interoperability with C. Combining packed pragma with inheritance is not +defined, and it should not be used with GC'ed memory (ref's). + +**Future directions**: Using GC'ed memory in packed pragma will result in +compile-time error. Usage with inheritance should be defined and documented. Unchecked pragma ---------------- diff --git a/web/news.txt b/web/news.txt index 83863cdd9..9c84b5490 100644 --- a/web/news.txt +++ b/web/news.txt @@ -61,6 +61,8 @@ News evaluation. - ``--gc:none`` produces warnings when code uses the GC. - A ``union`` pragma for better C interoperability is now supported. + - A ``packed`` pragma to control the memory packing/alignment of fields in + an object. - Arrays can be annotated to be ``unchecked`` for easier low level manipulations of memory. |