diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-09-21 18:38:25 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-09-21 18:38:25 +0200 |
| commit | 213e5625a9aa677230f261fcee01086f9ee1f850 (patch) | |
| tree | 21a422f2152f0f1921b431199acb69cc7568e07b /src/allocators/scalloc.py | |
| parent | 84eec0baba49bff0a5c2b64834bc2d75d687e7b5 (diff) | |
| download | allocbench-213e5625a9aa677230f261fcee01086f9ee1f850.tar.gz allocbench-213e5625a9aa677230f261fcee01086f9ee1f850.zip | |
replace AllocatorSources with Artifacts
Diffstat (limited to 'src/allocators/scalloc.py')
| -rw-r--r-- | src/allocators/scalloc.py | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/allocators/scalloc.py b/src/allocators/scalloc.py index 0b3d3cf..82ef8d1 100644 --- a/src/allocators/scalloc.py +++ b/src/allocators/scalloc.py @@ -17,32 +17,25 @@ """Scalloc definition for allocbench""" -from src.allocator import Allocator, AllocatorSources -from src.util import print_error - - -VERSION = "v1.0.0" - -SCALLOC_SRC = AllocatorSources("scalloc", - retrieve_cmds=["git clone https://github.com/cksystemsgroup/scalloc"], - prepare_cmds=[f"git checkout {VERSION}", - "cd {srcdir}; tools/make_deps.sh", - "cd {srcdir}; build/gyp/gyp --depth=. scalloc.gyp"], - reset_cmds=["git reset --hard"]) +from src.allocator import Allocator +from src.artifact import GitArtifact class Scalloc(Allocator): """Scalloc allocator""" - def __init__(self, name, **kwargs): - kwargs["sources"] = SCALLOC_SRC + sources = GitArtifact("scalloc", "https://github.com/cksystemsgroup/scalloc") + + def __init__(self, name, **kwargs): + self.prepare_cmds = ["tools/make_deps.sh", + "build/gyp/gyp --depth=. scalloc.gyp"] - kwargs["build_cmds"] = ["cd {srcdir}; BUILDTYPE=Release make", - "mkdir -p {dir}"] + self.build_cmds = ["cd {srcdir}; BUILDTYPE=Release make", + "mkdir -p {dir}"] - kwargs["LD_PRELOAD"] = "{srcdir}/out/Release/lib.target/libscalloc.so" + self.LD_PRELOAD = "{srcdir}/out/Release/lib.target/libscalloc.so" - kwargs["patches"] = ["{patchdir}/scalloc_fix_log.patch"] + self.patches = ["{patchdir}/scalloc_fix_log.patch"] super().__init__(name, **kwargs) @@ -57,4 +50,4 @@ sysctl vm.overcommit_memory=1 return super().build() -scalloc = Scalloc("scalloc", color="xkcd:magenta") +scalloc = Scalloc("scalloc", color="xkcd:magenta", version="v1.0.0") |
