mirror of
https://github.com/termux/termux-packages.git
synced 2025-02-21 15:16:41 +00:00
66 lines
1.7 KiB
Diff
66 lines
1.7 KiB
Diff
https://github.com/termux/termux-packages/issues/22907
|
|
|
|
--- a/layout/generic/IntrinsicISizesCache.h
|
|
+++ b/layout/generic/IntrinsicISizesCache.h
|
|
@@ -131,25 +131,14 @@
|
|
};
|
|
|
|
// If the high bit of mOutOfLine is 1, then it points to an OutOfLineCache.
|
|
+ bool mIsOutOfLine = false;
|
|
union {
|
|
InlineCache mInline;
|
|
- struct {
|
|
-#ifndef HAVE_64BIT_BUILD
|
|
- uintptr_t mPadding = 0;
|
|
-#endif
|
|
- uintptr_t mOutOfLine = 0;
|
|
- };
|
|
+ uintptr_t mOutOfLine = 0;
|
|
};
|
|
|
|
- static constexpr uintptr_t kHighBit = uintptr_t(1)
|
|
- << (sizeof(void*) * CHAR_BIT - 1);
|
|
-
|
|
bool IsOutOfLine() const {
|
|
-#ifdef HAVE_64BIT_BUILD
|
|
- return mOutOfLine & kHighBit;
|
|
-#else
|
|
- return mPadding & kHighBit;
|
|
-#endif
|
|
+ return mIsOutOfLine;
|
|
}
|
|
bool IsInline() const { return !IsOutOfLine(); }
|
|
OutOfLineCache* EnsureOutOfLine() {
|
|
@@ -159,13 +148,8 @@
|
|
auto inlineCache = mInline;
|
|
auto* ool = new OutOfLineCache();
|
|
ool->mCacheWithoutPercentageBasis = inlineCache;
|
|
-#ifdef HAVE_64BIT_BUILD
|
|
- MOZ_ASSERT((reinterpret_cast<uintptr_t>(ool) & kHighBit) == 0);
|
|
- mOutOfLine = reinterpret_cast<uintptr_t>(ool) | kHighBit;
|
|
-#else
|
|
mOutOfLine = reinterpret_cast<uintptr_t>(ool);
|
|
- mPadding = kHighBit;
|
|
-#endif
|
|
+ mIsOutOfLine = true;
|
|
MOZ_ASSERT(IsOutOfLine());
|
|
return ool;
|
|
}
|
|
@@ -174,16 +158,10 @@
|
|
if (!IsOutOfLine()) {
|
|
return nullptr;
|
|
}
|
|
-#ifdef HAVE_64BIT_BUILD
|
|
- return reinterpret_cast<OutOfLineCache*>(mOutOfLine & ~kHighBit);
|
|
-#else
|
|
return reinterpret_cast<OutOfLineCache*>(mOutOfLine);
|
|
-#endif
|
|
}
|
|
};
|
|
|
|
-static_assert(sizeof(IntrinsicISizesCache) == 8, "Unexpected cache size");
|
|
-
|
|
} // namespace mozilla
|
|
|
|
#endif
|