Extract initializing singleton marker

* Extract kInitializingSingleton marker
* Extract isNullOrMarker helper function
This commit is contained in:
Alexander Shabalin
2021-03-19 08:19:10 +00:00
committed by Space
parent b3ae30fdea
commit 5b1c30c198
4 changed files with 15 additions and 11 deletions
@@ -113,6 +113,11 @@ ALWAYS_INLINE bool isFrozen(const ObjHeader* obj);
ALWAYS_INLINE bool isPermanentOrFrozen(const ObjHeader* obj);
ALWAYS_INLINE bool isShareable(const ObjHeader* obj);
static inline ObjHeader* const kInitializingSingleton = reinterpret_cast<ObjHeader*>(1);
ALWAYS_INLINE inline bool isNullOrMarker(const ObjHeader* obj) noexcept {
return reinterpret_cast<uintptr_t>(obj) <= 1;
}
class ForeignRefManager;
typedef ForeignRefManager* ForeignRefContext;