Bug 1731218 - Part 6: Check that we don't increase the size of Rooted for GC thing types r=sfink

Differential Revision: https://phabricator.services.mozilla.com/D125955
This commit is contained in:
Jon Coppeard 2021-09-21 11:17:51 +00:00
parent c6196ebacd
commit 032eecdec3

View File

@ -51,6 +51,9 @@ template <typename T>
static inline void TraceExactStackRootList(JSTracer* trc,
StackRootedBase* listHead,
const char* name) {
// Check size of Rooted<T> does not increase.
static_assert(sizeof(Rooted<T>) == sizeof(T) + 2 * sizeof(uintptr_t));
for (StackRootedBase* root = listHead; root; root = root->previous()) {
static_cast<Rooted<T>*>(root)->trace(trc, name);
}