From 06354eda6092add55034c692bd65734a61083e8b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 8 Oct 2011 20:06:37 -0700 Subject: fix dlmalloc speed regression --- src/dlmalloc.c | 4 +++- tests/runner.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dlmalloc.c b/src/dlmalloc.c index 864117dd..aa37dc0d 100644 --- a/src/dlmalloc.c +++ b/src/dlmalloc.c @@ -1,7 +1,9 @@ + #define __THROW #define __attribute_malloc__ #define __wur + /* This is a version (aka dlmalloc) of malloc/free/realloc written by Doug Lea and released to the public domain, as explained at @@ -592,7 +594,7 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP #define MMAP_CLEARS 1 #endif /* MMAP_CLEARS */ #ifndef HAVE_MREMAP -#if linux +#ifdef linux #define HAVE_MREMAP 1 #else /* linux */ #define HAVE_MREMAP 0 diff --git a/tests/runner.py b/tests/runner.py index 4f2cc43f..49083092 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -2975,7 +2975,7 @@ if 'benchmark' not in str(sys.argv): def test_dlmalloc(self): global CORRECT_SIGNS; CORRECT_SIGNS = 2 - global CORRECT_SIGNS_LINES; CORRECT_SIGNS_LINES = ['src.cpp:' + str(i) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]] + global CORRECT_SIGNS_LINES; CORRECT_SIGNS_LINES = ['src.cpp:' + str(i+4) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]] global TOTAL_MEMORY; TOTAL_MEMORY = 100*1024*1024 # needed with typed arrays src = open(path_from_root('src', 'dlmalloc.c'), 'r').read() + '\n\n\n' + open(path_from_root('tests', 'dlmalloc_test.c'), 'r').read() @@ -4410,7 +4410,7 @@ else: def test_dlmalloc(self): global COMPILER_TEST_OPTS; COMPILER_TEST_OPTS = ['-g'] global CORRECT_SIGNS; CORRECT_SIGNS = 2 - global CORRECT_SIGNS_LINES; CORRECT_SIGNS_LINES = ['src.cpp:' + str(i) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]] + global CORRECT_SIGNS_LINES; CORRECT_SIGNS_LINES = ['src.cpp:' + str(i+4) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]] src = open(path_from_root('src', 'dlmalloc.c'), 'r').read() + '\n\n\n' + open(path_from_root('tests', 'dlmalloc_test.c'), 'r').read() self.do_benchmark(src, ['400', '400'], '*400,0*') -- cgit v1.2.3-18-g5258