aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-08-21 17:57:11 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-08-21 17:57:11 +0200
commit084b3ce3c13fe03e509e38a48184d23d8d532dc4 (patch)
treededbd486153134906f5d3f5303c1b7e1c6b754f7
parent3ea7840d641ebae59a5ae2af2dc4c1cad370b4df (diff)
downloadallocbench-084b3ce3c13fe03e509e38a48184d23d8d532dc4.tar.gz
allocbench-084b3ce3c13fe03e509e38a48184d23d8d532dc4.zip
add snmalloc definition
-rw-r--r--src/allocators/snmalloc.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/allocators/snmalloc.py b/src/allocators/snmalloc.py
new file mode 100644
index 0000000..0cc4dc7
--- /dev/null
+++ b/src/allocators/snmalloc.py
@@ -0,0 +1,25 @@
+import src.allocator
+
+version = "master"
+
+snmalloc_src = src.allocator.Allocator_Sources("snmalloc",
+ ["git clone https://github.com/microsoft/snmalloc"],
+ ["git checkout ".format(version)],
+ ["git reset --hard"])
+
+
+class Snmalloc (src.allocator.Allocator):
+ """snmalloc definition for allocbench"""
+ def __init__(self, name, **kwargs):
+
+ kwargs["sources"] = snmalloc_src
+ kwargs["LD_PRELOAD"] = "{dir}/libsnmallocshim.so"
+ kwargs["build_cmds"] = ["mkdir -p {dir}",
+ "cd {dir}; cmake -G Ninja {srcdir} -DCMAKE_BUILD_TYPE=Release",
+ "cd {dir}; ninja"]
+ kwargs["requirements"] = ["cmake", "ninja", "clang"]
+
+ super().__init__(name, **kwargs)
+
+
+snmalloc = Snmalloc("snmalloc")