aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/llalloc.py
blob: 84d492681c20924085d31c2f778cc156b5e72c5b (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
from src.allocator import Allocator, Allocator_Sources, library_path


source = Allocator_Sources("lockless_allocator",
                      retrieve_cmds=["wget https://locklessinc.com/downloads/lockless_allocator_src.tgz",
                                     "tar xf lockless_allocator_src.tgz"],
                      prepare_cmds=[],
                      reset_cmds=[])


class Lockless_Allocator (Allocator):
    """Lockless allocator definition for allocbench"""
    def __init__(self, name, **kwargs):

        kwargs["sources"] = source

        kwargs["build_cmds"] = ["cd {srcdir}; make", "mkdir -p {dir}"]
        
        kwargs["LD_PRELOAD"] = "{srcdir}/libllalloc.so.1.3"

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


llalloc = Lockless_Allocator("llalloc", color="purple")