Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vinniefalco/254e35c6212c948872af7d2e1dbe5c93 to your computer and use it in GitHub Desktop.
Save vinniefalco/254e35c6212c948872af7d2e1dbe5c93 to your computer and use it in GitHub Desktop.
inline
void
addref() const noexcept
{
//if(p_ && p_->counted_)
if(i_ & 1)
addref2();
}
inline
void
release2() const noexcept
{
auto p = get();
if(--p->refs_ == 0)
delete p;
}
inline
void
release() const noexcept
{
if(i_ & 1)
release2();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment