mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1165843 - Don't fire the pre-barrier in HeapPtr destructor r=terrence
This commit is contained in:
parent
5a1602109d
commit
8866b384ee
@ -345,7 +345,6 @@ class BarrieredBase : public BarrieredBaseMixins<T>
|
|||||||
T value;
|
T value;
|
||||||
|
|
||||||
explicit BarrieredBase(T v) : value(v) {}
|
explicit BarrieredBase(T v) : value(v) {}
|
||||||
~BarrieredBase() { pre(); }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init(T v) {
|
void init(T v) {
|
||||||
@ -400,6 +399,7 @@ class PreBarriered : public BarrieredBase<T>
|
|||||||
MOZ_IMPLICIT PreBarriered(T v) : BarrieredBase<T>(v) {}
|
MOZ_IMPLICIT PreBarriered(T v) : BarrieredBase<T>(v) {}
|
||||||
explicit PreBarriered(const PreBarriered<T>& v)
|
explicit PreBarriered(const PreBarriered<T>& v)
|
||||||
: BarrieredBase<T>(v.value) {}
|
: BarrieredBase<T>(v.value) {}
|
||||||
|
~PreBarriered() { this->pre(); }
|
||||||
|
|
||||||
/* Use to set the pointer to nullptr. */
|
/* Use to set the pointer to nullptr. */
|
||||||
void clear() {
|
void clear() {
|
||||||
@ -439,6 +439,7 @@ class HeapPtr : public BarrieredBase<T>
|
|||||||
explicit HeapPtr(const HeapPtr<T>& v) : BarrieredBase<T>(v) { post(); }
|
explicit HeapPtr(const HeapPtr<T>& v) : BarrieredBase<T>(v) { post(); }
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
~HeapPtr() {
|
~HeapPtr() {
|
||||||
|
// No prebarrier necessary as this only happens when we are sweeping.
|
||||||
MOZ_ASSERT(CurrentThreadIsGCSweeping());
|
MOZ_ASSERT(CurrentThreadIsGCSweeping());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -534,6 +535,7 @@ class RelocatablePtr : public BarrieredBase<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
~RelocatablePtr() {
|
~RelocatablePtr() {
|
||||||
|
this->pre();
|
||||||
if (GCMethods<T>::needsPostBarrier(this->value))
|
if (GCMethods<T>::needsPostBarrier(this->value))
|
||||||
relocate();
|
relocate();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user