Skip to content

Commit 06354ed

Browse files
committed
fix dlmalloc speed regression
1 parent 17cc630 commit 06354ed

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/dlmalloc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
12
#define __THROW
23
#define __attribute_malloc__
34
#define __wur
45

6+
57
/*
68
This is a version (aka dlmalloc) of malloc/free/realloc written by
79
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
592594
#define MMAP_CLEARS 1
593595
#endif /* MMAP_CLEARS */
594596
#ifndef HAVE_MREMAP
595-
#if linux
597+
#ifdef linux
596598
#define HAVE_MREMAP 1
597599
#else /* linux */
598600
#define HAVE_MREMAP 0

tests/runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,7 +2975,7 @@ def test_fasta(self):
29752975

29762976
def test_dlmalloc(self):
29772977
global CORRECT_SIGNS; CORRECT_SIGNS = 2
2978-
global CORRECT_SIGNS_LINES; CORRECT_SIGNS_LINES = ['src.cpp:' + str(i) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]]
2978+
global CORRECT_SIGNS_LINES; CORRECT_SIGNS_LINES = ['src.cpp:' + str(i+4) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]]
29792979
global TOTAL_MEMORY; TOTAL_MEMORY = 100*1024*1024 # needed with typed arrays
29802980

29812981
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 @@ def test_raytrace(self):
44104410
def test_dlmalloc(self):
44114411
global COMPILER_TEST_OPTS; COMPILER_TEST_OPTS = ['-g']
44124412
global CORRECT_SIGNS; CORRECT_SIGNS = 2
4413-
global CORRECT_SIGNS_LINES; CORRECT_SIGNS_LINES = ['src.cpp:' + str(i) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]]
4413+
global CORRECT_SIGNS_LINES; CORRECT_SIGNS_LINES = ['src.cpp:' + str(i+4) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]]
44144414

44154415
src = open(path_from_root('src', 'dlmalloc.c'), 'r').read() + '\n\n\n' + open(path_from_root('tests', 'dlmalloc_test.c'), 'r').read()
44164416
self.do_benchmark(src, ['400', '400'], '*400,0*')

0 commit comments

Comments
 (0)