On 2014-04-02, 4:43 AM, Neil wrote:
Ehsan Akhgari wrote:

On 2014-04-01, 8:10 PM, Martin Thomson wrote:

count_type tmp = --mRefCnt;
if (tmp == 0) {
   delete this;
}

And how do we enforce people to write code like the above example
using the current Atomic interface?

Would WARN_UNUSED_RESULT help here, so that you remember to use the
result of the -- operator?

Yes, that came up on the bug as well, and it's a fallback strategy if my proposal doesn't win people's hearts and minds. But it has won some already, so let's hold off on that idea for now. :-)

Cheers,
Ehsan

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to