Issue 18219: Block decrement_count() is problematic in some cases (vsiplxx-rtf) Source: (Mr. Brooks Moses, brooks.moses(at)dpdx.net) Nature: Revision Severity: Minor 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(...); block.decrement_count(); 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". Resolution: In the interest of closing the current RTF so that the solutions to resolved issues can be made publically available, this issue is deferred to the next RTF. Disposition: Deferred Revised Text: Actions taken: October 23, 2012: received issue Discussion: End of Annotations:===== te: Tue, 23 Oct 2012 13:33:13 -0700 From: Brooks Moses User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 To: Subject: VSIPL++ issue (#22 from me) X-OriginalArrivalTime: 23 Oct 2012 20:33:14.0387 (UTC) FILETIME=[A058EE30:01CDB15D] Name: Brooks Moses Employer: Mentor Graphics mailFrom: brooks_moses@mentor.com Terms_Agreement: I agree Specification: VSIPL++ Section: 6.3.6 [block.dense.accessors] FormalNumber: ptc/2012-07-27 Version: 1.2 - FTF Beta 1 Doc_Year: 2012 Doc_Month: August Doc_Day: 10 Page: 39 Title: Block decrement_count() is problematic in some cases Nature: Bug Severity: Minor B1: Report Issue Description: 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(...); block.decrement_count(); 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". - Brooks