Title: [241581] trunk/Source/bmalloc
Revision
241581
Author
[email protected]
Date
2019-02-15 01:09:57 -0800 (Fri, 15 Feb 2019)

Log Message

[bmalloc] NSBundle-based application name check should be executed after debug-heap environment variable check
https://bugs.webkit.org/show_bug.cgi?id=194694

Reviewed by Mark Lam.

Interestingly, NSBundle allocates fair amount of memory and keeps it for a process-long time. For example, it
allocates global NSConcreteHashTable, which takes 2.5KB. This patch changes the order of gigacage-check, we
first check "Malloc=1" status, and then check the process name through NSBundle. This allows us to remove NSBundle
related allocation in JSC initialization in the system malloc mode.

* bmalloc/Gigacage.cpp:
(Gigacage::shouldBeEnabled):

Modified Paths

Diff

Modified: trunk/Source/bmalloc/ChangeLog (241580 => 241581)


--- trunk/Source/bmalloc/ChangeLog	2019-02-15 08:43:07 UTC (rev 241580)
+++ trunk/Source/bmalloc/ChangeLog	2019-02-15 09:09:57 UTC (rev 241581)
@@ -1,5 +1,20 @@
 2019-02-15  Yusuke Suzuki  <[email protected]>
 
+        [bmalloc] NSBundle-based application name check should be executed after debug-heap environment variable check
+        https://bugs.webkit.org/show_bug.cgi?id=194694
+
+        Reviewed by Mark Lam.
+
+        Interestingly, NSBundle allocates fair amount of memory and keeps it for a process-long time. For example, it
+        allocates global NSConcreteHashTable, which takes 2.5KB. This patch changes the order of gigacage-check, we
+        first check "Malloc=1" status, and then check the process name through NSBundle. This allows us to remove NSBundle
+        related allocation in JSC initialization in the system malloc mode.
+
+        * bmalloc/Gigacage.cpp:
+        (Gigacage::shouldBeEnabled):
+
+2019-02-15  Yusuke Suzuki  <[email protected]>
+
         [bmalloc] Do not start scavenger thread if we use system malloc
         https://bugs.webkit.org/show_bug.cgi?id=194674
 

Modified: trunk/Source/bmalloc/bmalloc/Gigacage.cpp (241580 => 241581)


--- trunk/Source/bmalloc/bmalloc/Gigacage.cpp	2019-02-15 08:43:07 UTC (rev 241580)
+++ trunk/Source/bmalloc/bmalloc/Gigacage.cpp	2019-02-15 09:09:57 UTC (rev 241581)
@@ -267,11 +267,11 @@
     std::call_once(
         onceFlag,
         [] {
-            if (!gigacageEnabledForProcess())
+            bool debugHeapEnabled = PerProcess<Environment>::get()->isDebugHeapEnabled();
+            if (debugHeapEnabled)
                 return;
 
-            bool result = !PerProcess<Environment>::get()->isDebugHeapEnabled();
-            if (!result)
+            if (!gigacageEnabledForProcess())
                 return;
             
             if (char* gigacageEnabled = getenv("GIGACAGE_ENABLED")) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to