Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Unified Diff: tools/binary_size/libsupersize/helpers.py

Issue 2816093002: FREEZE.unindexed (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/binary_size/libsupersize/describe.py ('k') | tools/binary_size/libsupersize/linker_map_parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/libsupersize/helpers.py
diff --git a/tools/binary_size/libsupersize/helpers.py b/tools/binary_size/libsupersize/helpers.py
index bddcd76479f26e71ea8ea3bcd867eb72bcca4b9d..bfeef034e13c4c44534180ad6bc2b255748b1586 100644
--- a/tools/binary_size/libsupersize/helpers.py
+++ b/tools/binary_size/libsupersize/helpers.py
@@ -4,8 +4,21 @@
"""Utility methods."""
+import multiprocessing
import os
SRC_ROOT = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
+
+
+def ForkAndCall(func, *args, **kwargs):
+ """Uses multiprocessing to run the given function in a fork'ed process.
+
+ Returns:
+ A Result object (call .get() to get the return value)
+ """
+ pool_of_one = multiprocessing.Pool(1)
+ result = pool_of_one.apply_async(func, args=args, kwds=kwargs)
+ pool_of_one.close()
+ return result
« no previous file with comments | « tools/binary_size/libsupersize/describe.py ('k') | tools/binary_size/libsupersize/linker_map_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698