aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/snmalloc.py
blob: 0cc4dc73d5c02bdcb1549fca7c892ca30ea50561 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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")