aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/mimalloc.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/allocators/mimalloc.py')
-rw-r--r--src/allocators/mimalloc.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/allocators/mimalloc.py b/src/allocators/mimalloc.py
new file mode 100644
index 0000000..b636a04
--- /dev/null
+++ b/src/allocators/mimalloc.py
@@ -0,0 +1,24 @@
+import src.allocator
+
+version = "master"
+
+mimalloc_src = src.allocator.Allocator_Sources("mimalloc",
+ ["git clone https://github.com/microsoft/mimalloc"],
+ ["git checkout ".format(version)],
+ ["git stash"])
+
+
+class Mimalloc (src.allocator.Allocator):
+ """mimalloc definition for allocbench"""
+ def __init__(self, name, **kwargs):
+
+ kwargs["sources"] = mimalloc_src
+ kwargs["LD_PRELOAD"] = "{dir}/libmimalloc.so"
+ kwargs["build_cmds"] = ["cd {srcdir}; mkdir -p {dir}",
+ "cd {dir}; cmake {srcdir}",
+ "cd {dir}; make"]
+
+ super().__init__(name, **kwargs)
+
+
+mimalloc = Mimalloc("mimalloc")