aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/jemalloc.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-06-17 14:54:26 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-06-17 14:54:26 +0200
commit0d192f8cf3c21b2382e227fab057dabe16ea5e8b (patch)
treed1182f33bd69e72fdde0a4731287f28c318ef109 /src/allocators/jemalloc.py
parent3988f2e21754208a548725c590fb42e372a32efa (diff)
downloadallocbench-0d192f8cf3c21b2382e227fab057dabe16ea5e8b.tar.gz
allocbench-0d192f8cf3c21b2382e227fab057dabe16ea5e8b.zip
reduce code duplication by giving each known allocator its own class
also move allocator related code to src/allocators
Diffstat (limited to 'src/allocators/jemalloc.py')
-rw-r--r--src/allocators/jemalloc.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/allocators/jemalloc.py b/src/allocators/jemalloc.py
new file mode 100644
index 0000000..c64f5af
--- /dev/null
+++ b/src/allocators/jemalloc.py
@@ -0,0 +1,20 @@
+import src.allocator
+
+version = "5.1.0"
+
+sources=src.allocator.Allocator_Sources("jemalloc",
+ retrieve_cmds=["git clone https://github.com/jemalloc/jemalloc.git"],
+ prepare_cmds=["git checkout {}".format(version), "./autogen.sh"])
+
+
+class Jemalloc (src.allocator.Allocator):
+ """jemalloc definition for allocbench"""
+ def __init__(self, name, **kwargs):
+
+ kwargs["sources"] = sources
+ kwargs["LD_PRELOAD"] = "{srcdir}/lib/libjemalloc.so"
+ kwargs["build_cmds"] = ["cd {srcdir}; ./configure --prefix={dir} CFLAGS=-O2",
+ "cd {srcdir}; make -j4",
+ "mkdir {dir}"]
+
+ super().__init__(name, **kwargs)