Skip to content
Permalink
Browse files

Be more permissive with refcount checks

Summary: D13106229 tightened `checkCount` a couple of these look like they should use the more permissive `checkCountZ`, particularly `hasZeroRefs`.  I had one of these fire while running a dbg sandbox.

Reviewed By: ricklavoie

Differential Revision: D13641087

fbshipit-source-id: 0f9d12dc1cd19061040d21513fdf85a468c011ee
  • Loading branch information...
mofarrell authored and hhvm-bot committed Jan 13, 2019
1 parent 0d5f393 commit 9c8088fde6ce7acb75f7aad00a361eefb937f854
Showing with 4 additions and 4 deletions.
  1. +4 −4 hphp/runtime/base/countable.h
@@ -186,25 +186,25 @@ ALWAYS_INLINE bool MaybeCountable::hasMultipleRefs() const {
}

ALWAYS_INLINE bool Countable::hasMultipleRefs() const {
assertx(checkCount());
assertx(checkCountZ());
if (one_bit_refcount) return m_count != OneReference;

return m_count > 1;
}

ALWAYS_INLINE bool MaybeCountable::hasExactlyOneRef() const {
assertx(checkCount());
assertx(checkCountZ());
return m_count == OneReference;
}

ALWAYS_INLINE bool MaybeCountable::hasZeroRefs() const {
assertx(checkCount());
assertx(checkCountZ());
if (one_bit_refcount) return false;
return m_count == 0;
}

ALWAYS_INLINE bool Countable::hasExactlyOneRef() const {
assertx(checkCount());
assertx(checkCountZ());
return m_count == OneReference;
}

0 comments on commit 9c8088f

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.