tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pthreads vs. overriden malloc



On Wed, Sep 13, 2017 at 15:58:11 +0200, Joerg Sonnenberger wrote:

> On Wed, Sep 13, 2017 at 04:48:54PM +0300, Valery Ushakov wrote:
> > On a typical cpu that would be the alignment of "long double" I guess.
> > (I haven't checked, but it looks like that's what TINY_MIN_2POW
> > ensures for "tiny" allocation).
> 
> Vector registers require 128 or even 256bit alignment. We have like most
> systems for a long time been guaranteeing 16 Bytes alignment.

BTW, jemalloc.c has:

#ifdef __arm__
#  define QUANTUM_2POW_MIN      3
...

Which implies, I gather, that on arm it's only 8 bytes, right?


Anyway, I'd still say that explicit posix_memalign() is better than
silent assumption.  (Not C99 aligned_alloc() though, as it imposes the
restriction that size is a multiple of alignment).

-uwe


Home | Main Index | Thread Index | Old Index