diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-03-17 02:48:18 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-03-17 02:48:18 +0000 |
commit | a1b8b1bf12217a1878c0313be262dc787cc02c68 (patch) | |
tree | d6b4308f0cf8c1372b9c4de1115db0d0d4ec7c94 | |
parent | 8b36025a21f210648b2e51c67a982c676d244ba1 (diff) | |
download | tor-a1b8b1bf12217a1878c0313be262dc787cc02c68.tar.gz tor-a1b8b1bf12217a1878c0313be262dc787cc02c68.zip |
r18851@catbus: nickm | 2008-03-16 22:35:48 -0400
Backport to 0.2.0 branch: Use 8k pages in openbsd malloc code on alpha. Bug and solution found by weasel. Also, when initializing openbsd malloc code, check that compiled page size matches output of getpagesize().
svn:r14059
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/common/OpenBSD_malloc_Linux.c | 9 |
2 files changed, 12 insertions, 1 deletions
@@ -27,6 +27,10 @@ Changes in version 0.2.0.22-rc - 2008-03-?? - Use proper log levels in the testsuite call of get_interface_address6(). - When using a nonstandard malloc, do not use the platform values for HAVE_MALLOC_GOOD_SIZE or HAVE_MALLOC_USABLE_SIZE. + - Make the openbsd malloc code use 8k pages on alpha CPUs. Bugfix on + 0.2.0.x. + - Detect mismatched page sizes when using --enable-openbsd-malloc. + Bugfix on 0.2.0.x. Changes in version 0.2.0.21-rc - 2008-03-02 diff --git a/src/common/OpenBSD_malloc_Linux.c b/src/common/OpenBSD_malloc_Linux.c index 802517654a..7773c70ef0 100644 --- a/src/common/OpenBSD_malloc_Linux.c +++ b/src/common/OpenBSD_malloc_Linux.c @@ -95,7 +95,7 @@ static pthread_mutex_t gen_mutex = PTHREAD_MUTEX_INITIALIZER; #define _MALLOC_LOCK() {pthread_mutex_lock(&gen_mutex);} #define _MALLOC_UNLOCK() {pthread_mutex_unlock(&gen_mutex);} -#if defined(__sparc__) +#if defined(__sparc__) || defined(__alpha__) #define malloc_pageshift 13U #endif /* __sparc__ */ @@ -786,6 +786,13 @@ malloc_init(void) " Will not be able to dump malloc stats on exit"); #endif /* MALLOC_STATS */ + if (malloc_pagesize != getpagesize()) { + wrterror("malloc() replacement compiled with a different " + "page size from what we're running with. Failing."); + errno = ENOMEM; + return; + } + /* Allocate one page for the page directory. */ page_dir = (struct pginfo **)MMAP(malloc_pagesize); |