aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/supermalloc.py
blob: 7b96b8099279a8effe3d950e6401eae672cb3c96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import src.allocator

version = "709663fb81ba091b0a78058869a644a272f4163d"

sources=src.allocator.Allocator_Sources("SuperMalloc",
            retrieve_cmds=["git clone https://github.com/kuszmaul/SuperMalloc"],
            prepare_cmds=["git checkout {}".format(version)])


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

        kwargs["sources"] = sources
        kwargs["LD_PRELOAD"] = "{srcdir}/release/lib/libsupermalloc.so"
        kwargs["build_cmds"] = ["cd {srcdir}/release; make CFLAGS=-O2",
                                "mkdir {dir}"]

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

supermalloc = SuperMalloc("SuperMalloc", color="C1")
allocators = {supermalloc.name: supermalloc.build()}