diff options
author | Moonchild <moonchild@palemoon.org> | 2021-01-26 22:42:46 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-01-26 22:42:46 +0000 |
commit | 8fd57ace20e1e6bb59dd83ed59f513954c0aed9d (patch) | |
tree | 7d35359f7361ec1a649429085010b2464f17059a | |
parent | 2836e514661df0ffd816cf957ecc35c968377fbe (diff) | |
download | UXP-8fd57ace20e1e6bb59dd83ed59f513954c0aed9d.tar UXP-8fd57ace20e1e6bb59dd83ed59f513954c0aed9d.tar.gz UXP-8fd57ace20e1e6bb59dd83ed59f513954c0aed9d.tar.lz UXP-8fd57ace20e1e6bb59dd83ed59f513954c0aed9d.tar.xz UXP-8fd57ace20e1e6bb59dd83ed59f513954c0aed9d.zip |
[DOM] Try to avoid slow shrinking GC during sync calls
-rw-r--r-- | dom/canvas/ImageBitmap.cpp | 2 | ||||
-rw-r--r-- | dom/workers/WorkerPrivate.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp index bb47618a6..62de20763 100644 --- a/dom/canvas/ImageBitmap.cpp +++ b/dom/canvas/ImageBitmap.cpp @@ -930,7 +930,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData, const Maybe<IntRect>& aCropRect, ErrorResult& aRv) { // Copy data into SourceSurface. - dom::Uint8ClampedArray array; + RootedTypedArray<Uint8ClampedArray> array(RootingCx()); DebugOnly<bool> inited = array.Init(aImageData.GetDataObject()); MOZ_ASSERT(inited); diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 860bf8468..1f8b3b70c 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -6392,7 +6392,7 @@ WorkerPrivate::GarbageCollectInternal(JSContext* aCx, bool aShrinking, if (aShrinking || aCollectChildren) { JS::PrepareForFullGC(aCx); - if (aShrinking) { + if (aShrinking && mSyncLoopStack.IsEmpty()) { JS::GCForReason(aCx, GC_SHRINK, JS::gcreason::DOM_WORKER); if (!aCollectChildren) { |