openbsd malloc on alpha

Nick Mathewson nickm at
Sun Mar 16 23:23:25 UTC 2008

On Sun, Mar 16, 2008 at 11:51:01PM +0100, Peter Palfrader wrote:
> Hi,
> it turns out the problem is that the pagesize on alpha is 8k.
> -#if defined(__sparc__)
> +#if defined(__sparc__) || defined (__alpha__)
>  #define        malloc_pageshift        13U
>  #endif /* __sparc__ */
> "fixes" the issue, but it's certainly not a nice fix.
> We should probably be using getpagesize() to find out the page size.
> I'm unsure if it's safe to use it at compile time and assume it will
> work on all the subarchs that the binary will run on.

That's quite clever.  How did you find it?  For now, I'll add an early
runtime check to make sure that runtime pagesize matches compile-time
page size when using openbsd-malloc.

(For an 0.2.1.x timeframe, it's possible we'll want to switch to
jemalloc, like Firefox is doing.)

More information about the tor-dev mailing list