Title: [247709] trunk/Source/bmalloc
Revision
247709
Author
[email protected]
Date
2019-07-22 17:09:36 -0700 (Mon, 22 Jul 2019)

Log Message

[bmalloc] IsoTLS is not deallocated in TLS destructor
https://bugs.webkit.org/show_bug.cgi?id=200019

Reviewed by Mark Lam.

TLS destructor for IsoTLS needs to deallocate memory used for IsoTLS itself.
While we are correctly deallocating old IsoTLS when extending it to the new one,
we lack deallocation when the thread is destroyed. IsoTLS is per-thread, so we
should destroy IsoTLS when a thread finishes.

* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::ensureEntries):
(bmalloc::IsoTLS::destructor):

Modified Paths

Diff

Modified: trunk/Source/bmalloc/ChangeLog (247708 => 247709)


--- trunk/Source/bmalloc/ChangeLog	2019-07-23 00:07:38 UTC (rev 247708)
+++ trunk/Source/bmalloc/ChangeLog	2019-07-23 00:09:36 UTC (rev 247709)
@@ -1,3 +1,19 @@
+2019-07-22  Yusuke Suzuki  <[email protected]>
+
+        [bmalloc] IsoTLS is not deallocated in TLS destructor
+        https://bugs.webkit.org/show_bug.cgi?id=200019
+
+        Reviewed by Mark Lam.
+
+        TLS destructor for IsoTLS needs to deallocate memory used for IsoTLS itself.
+        While we are correctly deallocating old IsoTLS when extending it to the new one,
+        we lack deallocation when the thread is destroyed. IsoTLS is per-thread, so we
+        should destroy IsoTLS when a thread finishes.
+
+        * bmalloc/IsoTLS.cpp:
+        (bmalloc::IsoTLS::ensureEntries):
+        (bmalloc::IsoTLS::destructor):
+
 2019-07-12  Keith Miller  <[email protected]>
 
         Increase JSValue cage size on iOS and reduce the max slide

Modified: trunk/Source/bmalloc/bmalloc/IsoTLS.cpp (247708 => 247709)


--- trunk/Source/bmalloc/bmalloc/IsoTLS.cpp	2019-07-23 00:07:38 UTC (rev 247708)
+++ trunk/Source/bmalloc/bmalloc/IsoTLS.cpp	2019-07-23 00:09:36 UTC (rev 247709)
@@ -114,6 +114,7 @@
                     entry->move(src, dst);
                     entry->destruct(src);
                 });
+            tls->~IsoTLS();
             vmDeallocate(tls, tls->size());
         }
         tls = newTLS;
@@ -141,6 +142,8 @@
             entry->scavenge(data);
             entry->destruct(data);
         });
+    tls->~IsoTLS();
+    vmDeallocate(tls, tls->size());
 }
 
 size_t IsoTLS::sizeForCapacity(unsigned capacity)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to