aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/snmalloc.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/allocators/snmalloc.py')
-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")