diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-12 04:59:52 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-12 04:59:52 +0000 |
commit | a2ab5362d6752f2524d1d45dbc3f7ba396f32339 (patch) | |
tree | abe182933f09d057b4d44fc0e5e26384f67048c6 /etc | |
parent | ba26a1fbbdf5b748b617c20b2079a2f67014ebde (diff) | |
download | ATCD-a2ab5362d6752f2524d1d45dbc3f7ba396f32339.tar.gz |
use OS.h/stdcpp.h instead of including headers directly
Diffstat (limited to 'etc')
-rw-r--r-- | etc/ACE-guidelines.html | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/etc/ACE-guidelines.html b/etc/ACE-guidelines.html index ff25c81ba38..075f72aa73b 100644 --- a/etc/ACE-guidelines.html +++ b/etc/ACE-guidelines.html @@ -95,6 +95,11 @@ to Graham for providing the OSE tools!<p> <li><strong>Preprocessor</strong><p> <ul> + <li>Never #include standard headers directly, except in a few + specific ACE files, <em>e.g.</em>, OS.h and stdcpp.h. Let + those files #include the correct headers. If you don't do + this, your code will not compile with the Standard C++ Library.<p> + <li>Always follow a preprocessor <strong><code>#endif</code></strong> with a <strong><code>/* */</code></strong> C-style comment. It should correspond to the condition in the matching @@ -180,7 +185,7 @@ to Graham for providing the OSE tools!<p> <li>Never use <strong><code>delete</code></strong> to deallocate memory that was allocated with <strong><code>malloc</code></strong>. Similarly, never associate <strong><code>free</code></strong> with - <strong><code>new</code></strong>. Ideally, + <strong><code>new</code></strong>. <strong><code>ACE_NEW</code></strong> or <strong><code>ACE_NEW_RETURN</code></strong> should be used to allocate memory, and <strong><code>delete</code></strong> should @@ -189,6 +194,11 @@ to Graham for providing the OSE tools!<p> <strong><code>delete []</code></strong> to correspond to the allocation.<p> + <li>Always use <strong><code>ACE_NEW</code></strong> or + <strong><code>ACE_NEW_RETURN</code></strong> to allocate memory, + because they check for successful allocation and set errno + appropriately if it fails.<p> + <li>Never compare or assign a pointer value with <strong>NULL</strong>; use <strong>0</strong> instead. The language allows any pointer to be compared or assigned with <strong>0</strong>. The definition @@ -261,7 +271,7 @@ to Graham for providing the OSE tools!<p> <h3><a href="http://www.cs.wustl.edu/~levine/CVS.html">ACE</a> Design Rules</h3> <ul> - <li>>If you are parameterizing a searchable container template class + <li>If you are parameterizing a searchable container template class with readers/writer locks, do not use sentinels.<p> </ul><p> |