aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/allocators/all.py4
-rw-r--r--src/allocators/mimalloc.py24
2 files changed, 27 insertions, 1 deletions
diff --git a/src/allocators/all.py b/src/allocators/all.py
index 9afacf7..d39c165 100644
--- a/src/allocators/all.py
+++ b/src/allocators/all.py
@@ -10,7 +10,9 @@ from src.allocators.scalloc import scalloc
from src.allocators.supermalloc import supermalloc
from src.allocators.llalloc import llalloc
from src.allocators.tbbmalloc import tbbmalloc
+from src.allocators.mimalloc import mimalloc
allocators = [*src.allocators.glibcs.allocators, tcmalloc, tcmalloc_nofs,
- jemalloc, hoard, mesh, supermalloc, scalloc, llalloc, tbbmalloc]
+ jemalloc, hoard, mesh, supermalloc, scalloc, llalloc, tbbmalloc,
+ mimalloc]
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")