Boost C++ Libraries: Ticket #8358: queue::push incoherent documentation https://svn.boost.org/trac10/ticket/8358 <p> The documentation of queue::push states in the postcondition that the object is pushed if the queue if internal node can be allocated, but this in contradiction with Note that states that a new node could be allocated from the OS. </p> <p> I suggest to add a Effects clause to all the documentation to states clearly the effects of each function, as it done for the C++ standard and a lot of Boost libraries. </p> <pre class="wiki">bool push(T const &amp; t); Pushes object t to the queue. Note Thread-safe. If internal memory pool is exhausted and the memory pool is not fixed-sized, a new node will be allocated from the OS. This may not be lock-free. Postconditions: object will be pushed to the queue, if internal node can be allocated Returns: true, if the push operation is successful. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8358 Trac 1.4.3 timblechmann Sun, 31 Mar 2013 10:24:26 GMT <link>https://svn.boost.org/trac10/ticket/8358#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8358#comment:1</guid> <description> <p> it is not really a contradiction, because the queue has two allocation schemes: </p> <ul><li>an internal memory pool </li><li>the OS </li></ul><p> both allocation schemes may fail. changing the <code>postconditon' clause to </code>effects' might be reasonable, though ... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Mon, 01 Apr 2013 16:15:51 GMT</pubDate> <title>summary changed https://svn.boost.org/trac10/ticket/8358#comment:2 https://svn.boost.org/trac10/ticket/8358#comment:2 <ul> <li><strong>summary</strong> <span class="trac-field-old">queue::push inchorent documentation</span> → <span class="trac-field-new">queue::push incoherent documentation</span> </li> </ul> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/8358#comment:1" title="Comment 1">timblechmann</a>: </p> <blockquote class="citation"> <p> it is not really a contradiction, because the queue has two allocation schemes: </p> <ul><li>an internal memory pool </li><li>the OS </li></ul><p> both allocation schemes may fail. changing the <code>postconditon' clause to </code>effects' might be reasonable, though ... </p> </blockquote> <p> The problem is when internal memory pool fail but OS gives you memory. In this case the current postcondition is false as the object will be pushed to the queue even if the internal pool fails. </p> Ticket anonymous Mon, 01 Apr 2013 16:20:01 GMT <link>https://svn.boost.org/trac10/ticket/8358#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8358#comment:3</guid> <description> <blockquote class="citation"> <p> The problem is when internal memory pool fail but OS gives you memory. In this case the current postcondition is false as the object will be pushed to the queue even if the internal pool fails. </p> </blockquote> <p> not really, but maybe 'internal node' is ambiguous: it is 'internal' as in 'internally used' node, not 'allocated from the internal freelist' ... hm </p> </description> <category>Ticket</category> </item> </channel> </rss>