From ae0680f8fdd4de34fc85bea869699535f7abf0b9 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 28 Aug 2019 11:31:08 +0200 Subject: improve code quality and add license headers to allocator definitions --- src/allocators/snmalloc.py | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) (limited to 'src/allocators/snmalloc.py') diff --git a/src/allocators/snmalloc.py b/src/allocators/snmalloc.py index 0cc4dc7..0496196 100644 --- a/src/allocators/snmalloc.py +++ b/src/allocators/snmalloc.py @@ -1,18 +1,37 @@ -import src.allocator - -version = "master" - -snmalloc_src = src.allocator.Allocator_Sources("snmalloc", +# Copyright 2018-2019 Florian Fischer +# +# This file is part of allocbench. +# +# allocbench is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# allocbench is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with allocbench. + +"""Snmalloc definition for allocbench""" + +from src.allocator import Allocator, AllocatorSources + +VERSION = "master" + +SNMALLOC_SRC = AllocatorSources("snmalloc", ["git clone https://github.com/microsoft/snmalloc"], - ["git checkout ".format(version)], + [f"git checkout {VERSION}"], ["git reset --hard"]) -class Snmalloc (src.allocator.Allocator): - """snmalloc definition for allocbench""" +class Snmalloc(Allocator): + """snmalloc allocator""" def __init__(self, name, **kwargs): - kwargs["sources"] = snmalloc_src + kwargs["sources"] = SNMALLOC_SRC kwargs["LD_PRELOAD"] = "{dir}/libsnmallocshim.so" kwargs["build_cmds"] = ["mkdir -p {dir}", "cd {dir}; cmake -G Ninja {srcdir} -DCMAKE_BUILD_TYPE=Release", -- cgit v1.2.3