mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-23 21:17:52 +00:00
Bug 1549853 - Ignore associations of zero bytes of malloc memory with a GC thing r=sfink?
Differential Revision: https://phabricator.services.mozilla.com/D30355 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
94e50ef5a8
commit
75bfdb344c
8
dom/canvas/crashtests/1549853.html
Normal file
8
dom/canvas/crashtests/1549853.html
Normal file
@ -0,0 +1,8 @@
|
||||
<canvas id='a' height='67108864' width='80'></canvas>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var c=document.getElementById('a')
|
||||
var x=c.getContext('2d', {alpha: true})
|
||||
c.setAttribute('width', 800)
|
||||
})
|
||||
</script>
|
@ -1156,6 +1156,10 @@ JS_PUBLIC_API void JS_freeop(JSFreeOp* fop, void* p) {
|
||||
JS_PUBLIC_API void JS::AddAssociatedMemory(JSObject* obj, size_t nbytes,
|
||||
JS::MemoryUse use) {
|
||||
MOZ_ASSERT(obj);
|
||||
if (!nbytes) {
|
||||
return;
|
||||
}
|
||||
|
||||
Zone* zone = obj->zone();
|
||||
zone->updateMallocCounter(nbytes);
|
||||
zone->addCellMemory(obj, nbytes, use);
|
||||
@ -1165,6 +1169,10 @@ JS_PUBLIC_API void JS::AddAssociatedMemory(JSObject* obj, size_t nbytes,
|
||||
JS_PUBLIC_API void JS::RemoveAssociatedMemory(JSObject* obj, size_t nbytes,
|
||||
JS::MemoryUse use) {
|
||||
MOZ_ASSERT(obj);
|
||||
if (!nbytes) {
|
||||
return;
|
||||
}
|
||||
|
||||
obj->zoneFromAnyThread()->removeCellMemory(obj, nbytes, use);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user