VSIPL 1.6 RTF Avatar
  1. OMG Issue

VSIPL16 — Block decrement_count() is problematic in some cases

  • Key: VSIPL16-21
  • Legacy Issue Number: 18219
  • Status: open  
  • Source: dpdx.net ( Brooks Moses)
  • Summary:

    The effects of the decrement_count() accessor for blocks are described
    as "Decrease the object’s use count. If the count becomes zero, the
    block deallocates itself."

    This is not always possible. Consider, for instance, this simple code:

    Dense<...> block(...);

    Since block is created on the stack, it cannot deallocate itself.

    Similar issues will occur with blocks created using placement-new into
    existing allocated memory.

    At minimum, this should be addressed by a clause stating that the
    object's use-count shall not be decremented to zero (or allowed to
    become decremented to zero) except for blocks that have been created
    using "new".

  • Reported: VSIPL++ 1.2 — Tue, 23 Oct 2012 04:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT