aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/glibc.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-06-17 14:54:26 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-06-17 14:54:26 +0200
commit0d192f8cf3c21b2382e227fab057dabe16ea5e8b (patch)
treed1182f33bd69e72fdde0a4731287f28c318ef109 /src/allocators/glibc.py
parent3988f2e21754208a548725c590fb42e372a32efa (diff)
downloadallocbench-0d192f8cf3c21b2382e227fab057dabe16ea5e8b.tar.gz
allocbench-0d192f8cf3c21b2382e227fab057dabe16ea5e8b.zip
reduce code duplication by giving each known allocator its own class
also move allocator related code to src/allocators
Diffstat (limited to 'src/allocators/glibc.py')
-rw-r--r--src/allocators/glibc.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/allocators/glibc.py b/src/allocators/glibc.py
new file mode 100644
index 0000000..eff71dc
--- /dev/null
+++ b/src/allocators/glibc.py
@@ -0,0 +1,29 @@
+import src.allocator
+
+
+version = 2.29
+
+glibc_src = src.allocator.Allocator_Sources("glibc",
+ retrieve_cmds=["git clone git://sourceware.org/git/glibc.git"],
+ prepare_cmds=["git checkout release/{}/master".format(version)],
+ reset_cmds=["git stash"])
+
+class Glibc (src.allocator.Allocator):
+ """Glibc definition for allocbench"""
+ def __init__(self, name, **kwargs):
+
+ kwargs["sources"] = glibc_src
+
+ configure_args = ""
+ if "configure_args" in kwargs:
+ configure_args = kwargs["configure_args"]
+ del(kwargs["configure_args"])
+
+ kwargs["build_cmds"] = ["mkdir -p glibc-build",
+ "cd glibc-build; {srcdir}/configure --prefix={dir} " + configure_args,
+ "cd glibc-build; make",
+ "cd glibc-build; make install"]
+ kwargs["cmd_prefix"] = ("{dir}/lib/ld-linux-x86-64.so.2 --library-path {dir}/lib:"
+ + src.allocator.library_path)
+
+ super().__init__(name, **kwargs)