aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/allocators/all.py3
-rw-r--r--src/allocators/llalloc.py25
-rw-r--r--src/allocators/mesh.py22
-rw-r--r--src/allocators/supermalloc.py2
4 files changed, 50 insertions, 2 deletions
diff --git a/src/allocators/all.py b/src/allocators/all.py
index bf2babd..f68863d 100644
--- a/src/allocators/all.py
+++ b/src/allocators/all.py
@@ -6,6 +6,7 @@ from src.allocators.tcmalloc import tcmalloc, tcmalloc_nofs
from src.allocators.jemalloc import jemalloc
from src.allocators.hoard import hoard
from src.allocators.supermalloc import supermalloc
+from src.allocators.llalloc import llalloc
mesh = Alloc("Mesh", sources=Alloc_Src("Mesh",
@@ -18,4 +19,4 @@ mesh = Alloc("Mesh", sources=Alloc_Src("Mesh",
"mkdir {dir}"])
allocators = [*src.allocators.glibcs.allocators, tcmalloc, tcmalloc_nofs,
- jemalloc, hoard, mesh, supermalloc]
+ jemalloc, hoard, mesh, supermalloc, llalloc]
diff --git a/src/allocators/llalloc.py b/src/allocators/llalloc.py
new file mode 100644
index 0000000..073899c
--- /dev/null
+++ b/src/allocators/llalloc.py
@@ -0,0 +1,25 @@
+from src.allocator import Allocator, Allocator_Sources, library_path
+
+
+source = Allocator_Sources("lockless_allocator",
+ retrieve_cmds=["wget https://locklessinc.com/downloads/lockless_allocator_src.tgz",
+ "tar xf lockless_allocator_src.tgz"],
+ prepare_cmds=[],
+ reset_cmds=[])
+
+
+class Lockless_Allocator (Allocator):
+ """Lockless allocator definition for allocbench"""
+ def __init__(self, name, **kwargs):
+
+ kwargs["sources"] = source
+
+ kwargs["build_cmds"] = ["cd {srcdir}; make", "mkdir -p {dir}"]
+
+ kwargs["LD_PRELOAD"] = "{srcdir}/libllalloc.so.1.3"
+
+ super().__init__(name, **kwargs)
+
+
+llalloc = Lockless_Allocator("llalloc")
+
diff --git a/src/allocators/mesh.py b/src/allocators/mesh.py
new file mode 100644
index 0000000..843685b
--- /dev/null
+++ b/src/allocators/mesh.py
@@ -0,0 +1,22 @@
+import src.allocator
+
+sources = src.allocator.Allocator_Sources("Mesh",
+ retrieve_cmds=["git clone https://github.com/plasma-umass/Mesh"],
+ reset_cmds=["git stash"])
+
+
+class Mesh (src.allocator.Allocator):
+ """Mesh definition for allocbench"""
+ def __init__(self, name, **kwargs):
+
+ kwargs["sources"] = sources
+ kwargs["LD_PRELOAD"] = "{srcdir}/libmesh.so"
+ kwargs["build_cmds"] = ["cd {srcdir}; git submodule update --init",
+ "cd {srcdir}; ./configure",
+ "cd {srcdir}; make -j 4",
+ "mkdir -p {dir}"]
+
+ super().__init__(name, **kwargs)
+
+
+mesh = Mesh("Mesh")
diff --git a/src/allocators/supermalloc.py b/src/allocators/supermalloc.py
index 24fbb15..a8b5789 100644
--- a/src/allocators/supermalloc.py
+++ b/src/allocators/supermalloc.py
@@ -19,4 +19,4 @@ class SuperMalloc (src.allocator.Allocator):
super().__init__(name, **kwargs)
-supermalloc = SuperMalloc("SuperMalloc", color="C1")
+supermalloc = SuperMalloc("SuperMalloc")