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

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

Issue 2851473003: supersize: Track symbol aliases and shared symbols (Closed)
Patch Set: tweak nm interfface 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
Index: tools/binary_size/libsupersize/helpers.py
diff --git a/tools/binary_size/libsupersize/helpers.py b/tools/binary_size/libsupersize/helpers.py
index 4379f82dbbe2fea7796d4bfc79538c211b99e957..bddcd76479f26e71ea8ea3bcd867eb72bcca4b9d 100644
--- a/tools/binary_size/libsupersize/helpers.py
+++ b/tools/binary_size/libsupersize/helpers.py
@@ -4,40 +4,8 @@
"""Utility methods."""
-import atexit
-import multiprocessing
import os
-import threading
SRC_ROOT = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
-
-
-def MakeProcessPool(*args):
- """Wrapper for multiprocessing.Pool, with fix to terminate on exit."""
- ret = multiprocessing.Pool(*args)
- def close_pool():
- ret.terminate()
-
- def on_exit():
- thread = threading.Thread(target=close_pool)
- thread.daemon = True
- thread.start()
-
- # Without calling terminate() on a separate thread, the call can block
- # forever.
- atexit.register(on_exit)
- return ret
-
-
-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 = MakeProcessPool(1)
- result = pool_of_one.apply_async(func, args=args, kwds=kwargs)
- pool_of_one.close()
- return result

Powered by Google App Engine
This is Rietveld 408576698