From b59fba584521a0a9d4fe97ee4a5d608ec19aedc4 Mon Sep 17 00:00:00 2001 From: Audun Wilhelmsen Date: Thu, 20 Mar 2014 23:11:33 +0100 Subject: [PATCH 1/3] Added documentation for packed pragma --- doc/manual.txt | 5 +++++ web/news.txt | 1 + 2 files changed, 6 insertions(+) diff --git a/doc/manual.txt b/doc/manual.txt index ab1badaf38..9497e957d3 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -5390,6 +5390,11 @@ 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 is 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 inheretinence should be defined and documented. Unchecked pragma ---------------- diff --git a/web/news.txt b/web/news.txt index 83863cdd9b..7f5526665b 100644 --- a/web/news.txt +++ b/web/news.txt @@ -61,6 +61,7 @@ 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. From 1b423139e6b9997bdda97e32d1575df41f62cd0a Mon Sep 17 00:00:00 2001 From: Audun Wilhelmsen Date: Thu, 20 Mar 2014 23:47:50 +0100 Subject: [PATCH 2/3] Fixed typo and line breaks in docs --- doc/manual.txt | 9 +++++++-- web/news.txt | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/manual.txt b/doc/manual.txt index 9497e957d3..08ed6f8d16 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -5392,9 +5392,14 @@ 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 is 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). +The `packed`:idx: pragma can be applied to any ``object`` type. It ensures +that the fields of an object is 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 inheretinence should be defined and documented. +**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 7f5526665b..9c84b54901 100644 --- a/web/news.txt +++ b/web/news.txt @@ -61,7 +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. + - 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. From 2a182f55aeb22149d72f7f3e2e0c96019b8dcd17 Mon Sep 17 00:00:00 2001 From: Audun Wilhelmsen Date: Fri, 21 Mar 2014 18:10:27 +0100 Subject: [PATCH 3/3] Fixed typo in docs --- doc/manual.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual.txt b/doc/manual.txt index 08ed6f8d16..c4b08a942b 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -5393,7 +5393,7 @@ 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 is packed back-to-back in memory. It is useful +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).