aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/tcmalloc.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/tcmalloc.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/tcmalloc.py')
-rw-r--r--src/allocators/tcmalloc.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/allocators/tcmalloc.py b/src/allocators/tcmalloc.py
new file mode 100644
index 0000000..1eb0db4
--- /dev/null
+++ b/src/allocators/tcmalloc.py
@@ -0,0 +1,20 @@
+import src.allocator
+
+
+version = 2.7
+
+tcmalloc_src = src.allocator.Allocator_Sources("tcmalloc",
+ ["git clone https://github.com/gperftools/gperftools.git"],
+ ["git checkout gperftools-{}".format(version), "./autogen.sh"],
+ ["git stash"])
+
+class TCMalloc (src.allocator.Allocator):
+ """TCMalloc definition for allocbench"""
+ def __init__(self, name, **kwargs):
+
+ kwargs["sources"] = tcmalloc_src
+ kwargs["LD_PRELOAD"] = "{dir}/lib/libtcmalloc.so"
+ kwargs["build_cmds"] = ["cd {srcdir}; ./configure --prefix={dir} CXXFLAGS=-O2",
+ "cd {srcdir}; make install -j4"]
+
+ super().__init__(name, **kwargs)