diff options
Diffstat (limited to 'src/allocators/snmalloc.py')
| -rw-r--r-- | src/allocators/snmalloc.py | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/allocators/snmalloc.py b/src/allocators/snmalloc.py index 0496196..7f27e4b 100644 --- a/src/allocators/snmalloc.py +++ b/src/allocators/snmalloc.py @@ -17,28 +17,23 @@ """Snmalloc definition for allocbench""" -from src.allocator import Allocator, AllocatorSources - -VERSION = "master" - -SNMALLOC_SRC = AllocatorSources("snmalloc", - ["git clone https://github.com/microsoft/snmalloc"], - [f"git checkout {VERSION}"], - ["git reset --hard"]) +from src.allocator import Allocator +from src.artifact import GitArtifact class Snmalloc(Allocator): """snmalloc allocator""" - 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"] + sources = GitArtifact("snmalloc", "https://github.com/microsoft/snmalloc") + + def __init__(self, name, **kwargs): + self.LD_PRELOAD = "{dir}/libsnmallocshim.so" + self.build_cmds = ["mkdir -p {dir}", + "cd {dir}; cmake -G Ninja {srcdir} -DCMAKE_BUILD_TYPE=Release", + "cd {dir}; ninja"] + self.requirements = ["cmake", "ninja", "clang"] super().__init__(name, **kwargs) -snmalloc = Snmalloc("snmalloc") +snmalloc = Snmalloc("snmalloc", version="0.2") |
