From 2d86e20f5a44aea66725686531463931f38aa2dc Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 24 Jun 2019 14:51:21 +0200 Subject: rework allocator definitions #2 bench.py no evals only if argument to -a is file path. Otherwise it will check if "arg".py is found in src/allocators/ then it imports it. Collection definitions must export a iterable member called allocators. Allocator definitions must export a member named "arg". --- src/allocators/installed_allocators.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/allocators/installed_allocators.py') diff --git a/src/allocators/installed_allocators.py b/src/allocators/installed_allocators.py index 26fab5b..c478f13 100644 --- a/src/allocators/installed_allocators.py +++ b/src/allocators/installed_allocators.py @@ -1,16 +1,13 @@ """Default allocators using system libraries""" -import os import subprocess -import src.globalvars - maybe_allocators = ["tcmalloc", "jemalloc", "hoard"] -src.globalvars.allocators = {"libc": {"cmd_prefix" : "", - "binary_suffix" : "", - "LD_PRELOAD" : "", - "color" : "C1"}} +allocators = {"libc": {"cmd_prefix": "", + "binary_suffix": "", + "LD_PRELOAD": "", + "color": "C1"}} for i, t in enumerate(maybe_allocators): try: @@ -19,9 +16,9 @@ for i, t in enumerate(maybe_allocators): universal_newlines=True).stdout.strip() if path != "": - src.globalvars.allocators[t] = {"cmd_prefix": "", - "binary_suffix": "", - "LD_PRELOAD": path, - "color": "C"+str(i+2)} + allocators[t] = {"cmd_prefix": "", + "binary_suffix": "", + "LD_PRELOAD": path, + "color": "C"+str(i+2)} except: pass -- cgit v1.2.3