aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/mimalloc.py
blob: b636a042aab374a67809f2b995378490a9a12ead (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
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")