This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Malloc improvements
- From: Anton Blanchard <anton at au1 dot ibm dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: carlos at redhat dot com, sid at reserved-bit dot com, libc-alpha at sourceware dot org
- Date: Wed, 13 Jul 2016 18:58:25 +1000
- Subject: Re: Malloc improvements
- Authentication-results: sourceware.org; auth=none
- References: <20160712101010.6e6cfecb@kryten> <xnlh17k7qt.fsf@greed.delorie.com>
Hi DJ,
> Hmmm... not sure why that test case is worse in my branch, the whole
> point of my work is to add a lockless fast path. I'll have to
> investigate that some more. Conveniently, I have a trace feature in
> there that I'm also working on ;-)
I took a look at this, and malloc(8) is trying to grab from tc_idx 2,
but free() is returning it to tc_idx 3.
Inside malloc(), size2tidx() rounds the request up to 32 bytes, but in
free() size is 48 bytes, size-SIZE_SZ is 40, and this causes us to
return it to tc_idx 3. Did we add 16B of padding instead of 8?
Anton