aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/tbbmalloc.py
blob: a5b28b73016b15f510a2086d9834a436960adbf3 (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 = "2019_U8"

source = src.allocator.Allocator_Sources("tbb",
                         ["git clone https://github.com/intel/tbb.git"],
                         ["git checkout {}".format(version)],
                         ["git reset --hard"])


class TBBMalloc (src.allocator.Allocator):
    """TCMalloc definition for allocbench"""
    def __init__(self, name, **kwargs):

        kwargs["sources"] = source
        kwargs["LD_PRELOAD"] = "{dir}/libtbbmalloc.so"
        kwargs["build_cmds"] = ["cd {srcdir}; make tbbmalloc -j4",
                                "mkdir -p {dir}",
                                'ln -f -s $(find {srcdir} -executable -name "*libtbbmalloc_proxy.so*") {dir}/libtbbmalloc.so | head -1']

        super().__init__(name, **kwargs)


tbbmalloc = TBBMalloc("tbbmalloc", color="xkcd:green")