diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2020-07-19 17:07:18 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2020-07-19 17:07:48 +0200 |
| commit | 4dc95d03d37d1093bb7800a0b62a1d7fed4e35a7 (patch) | |
| tree | 6892f6da045394016dcf459b9edab2882fd77d91 | |
| parent | 3f63c434b41b261effda4ff6c0e9c95fc5eb06b9 (diff) | |
| download | allocbench-4dc95d03d37d1093bb7800a0b62a1d7fed4e35a7.tar.gz allocbench-4dc95d03d37d1093bb7800a0b62a1d7fed4e35a7.zip | |
[allocator] add new "system_default" allocator using an empty AllocatorDict
| -rw-r--r-- | allocbench/allocator.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/allocbench/allocator.py b/allocbench/allocator.py index f66a607..db5f988 100644 --- a/allocbench/allocator.py +++ b/allocbench/allocator.py @@ -191,20 +191,23 @@ class Allocator: return res_dict +def create_empty_allocator_dict() -> AllocatorDict: + """Return an empty allocator dict""" + return { + "cmd_prefix": "", + "binary_suffix": "", + "LD_PRELOAD": "", + "LD_LIBRARY_PATH": "", + "color": None + } + + def collect_installed_allocators() -> AllocatorCollection: """Collect allocators using installed system libraries""" maybe_allocators = list(collect_available_allocators().keys()) - allocators = { - "libc": { - "cmd_prefix": "", - "binary_suffix": "", - "LD_PRELOAD": "", - "LD_LIBRARY_PATH": "", - "color": None - } - } + allocators = {"system_default": create_empty_allocator_dict()} for alloc in maybe_allocators: try: @@ -295,6 +298,8 @@ def collect_allocators( alloc_name: alloc.build() for alloc_name, alloc in available_allocators.items() } + if name == "system_default": + return {"system_default": create_empty_allocator_dict()} # file exists -> interpret as python file with a global variable allocators if os.path.isfile(name): |
