aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/tcmalloc.py
diff options
context:
space:
mode:
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)