From 0d192f8cf3c21b2382e227fab057dabe16ea5e8b Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 17 Jun 2019 14:54:26 +0200 Subject: reduce code duplication by giving each known allocator its own class also move allocator related code to src/allocators --- src/allocators/supermalloc.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/allocators/supermalloc.py (limited to 'src/allocators/supermalloc.py') diff --git a/src/allocators/supermalloc.py b/src/allocators/supermalloc.py new file mode 100644 index 0000000..7b96b80 --- /dev/null +++ b/src/allocators/supermalloc.py @@ -0,0 +1,22 @@ +import src.allocator + +version = "709663fb81ba091b0a78058869a644a272f4163d" + +sources=src.allocator.Allocator_Sources("SuperMalloc", + retrieve_cmds=["git clone https://github.com/kuszmaul/SuperMalloc"], + prepare_cmds=["git checkout {}".format(version)]) + + +class SuperMalloc (src.allocator.Allocator): + """jemalloc definition for allocbench""" + def __init__(self, name, **kwargs): + + kwargs["sources"] = sources + kwargs["LD_PRELOAD"] = "{srcdir}/release/lib/libsupermalloc.so" + kwargs["build_cmds"] = ["cd {srcdir}/release; make CFLAGS=-O2", + "mkdir {dir}"] + + super().__init__(name, **kwargs) + +supermalloc = SuperMalloc("SuperMalloc", color="C1") +allocators = {supermalloc.name: supermalloc.build()} -- cgit v1.2.3