This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch dj/malloc-tcache updated. glibc-2.24-669-gab51781
- From: dj at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 26 Jan 2017 18:28:27 -0000
- Subject: GNU C Library master sources branch dj/malloc-tcache updated. glibc-2.24-669-gab51781
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, dj/malloc-tcache has been updated
via ab517814a8108cfa1f000e9bce6dda0297056e7f (commit)
from 6b13755a7fd5a95d1b1911955cce6041c1a782f0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ab517814a8108cfa1f000e9bce6dda0297056e7f
commit ab517814a8108cfa1f000e9bce6dda0297056e7f
Author: DJ Delorie <dj@delorie.com>
Date: Thu Jan 26 13:27:46 2017 -0500
Style tweaks
Minor tweaks to spacing, operator order, etc.
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 3da9f94..792e28a 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2970,7 +2970,7 @@ __libc_malloc (size_t bytes)
return (*hook)(bytes, RETURN_ADDRESS (0));
#if USE_TCACHE
/* int_free also calls request2size, be careful to not pad twice. */
- size_t tbytes = request2size(bytes);
+ size_t tbytes = request2size (bytes);
size_t tc_idx = csize2tidx (tbytes);
if (tc_idx < mp_.tcache_max
@@ -2980,7 +2980,7 @@ __libc_malloc (size_t bytes)
{
TCacheEntry *e = tcache.entries[tc_idx];
tcache.entries[tc_idx] = e->next;
- tcache.counts[tc_idx] --;
+ --tcache.counts[tc_idx];
return (void *) e;
}
#endif
@@ -3514,10 +3514,10 @@ _int_malloc (mstate av, size_t bytes)
!= tc_victim);
if (tc_victim != 0)
{
- TCacheEntry *e = (TCacheEntry *) chunk2mem(tc_victim);
+ TCacheEntry *e = (TCacheEntry *) chunk2mem (tc_victim);
e->next = tcache.entries[tc_idx];
tcache.entries[tc_idx] = e;
- tcache.counts[tc_idx] ++;
+ ++tcache.counts[tc_idx];
found ++;
}
}
@@ -3572,7 +3572,7 @@ _int_malloc (mstate av, size_t bytes)
/* While bin not empty and tcache not full, copy chunks over. */
while (tcache.counts[tc_idx] < mp_.tcache_count
- && (tc_victim = last(bin)) != bin)
+ && (tc_victim = last (bin)) != bin)
{
if (tc_victim != 0)
{
@@ -3583,16 +3583,13 @@ _int_malloc (mstate av, size_t bytes)
bin->bk = bck;
bck->fd = bin;
- TCacheEntry *e = (TCacheEntry *) chunk2mem(tc_victim);
+ TCacheEntry *e = (TCacheEntry *) chunk2mem (tc_victim);
e->next = tcache.entries[tc_idx];
tcache.entries[tc_idx] = e;
- tcache.counts[tc_idx] ++;
+ ++tcache.counts[tc_idx];
found ++;
- //_m_printf("snarf chunk %p %lx %p %lx\n", tc_victim, nb,
- // chunk_at_offset(tc_victim, nb), chunk_at_offset(tc_victim, nb)->size);
}
}
- //_m_printf("%d chunks found in smallbin\n", found);
}
#endif
void *p = chunk2mem (victim);
@@ -3709,10 +3706,10 @@ _int_malloc (mstate av, size_t bytes)
if (tcache_nb
&& tcache.counts[tc_idx] < mp_.tcache_count)
{
- TCacheEntry *e = (TCacheEntry *) chunk2mem(victim);
+ TCacheEntry *e = (TCacheEntry *) chunk2mem (victim);
e->next = tcache.entries[tc_idx];
tcache.entries[tc_idx] = e;
- tcache.counts[tc_idx] ++;
+ ++tcache.counts[tc_idx];
return_cached = 1;
continue;
}
@@ -3795,14 +3792,14 @@ _int_malloc (mstate av, size_t bytes)
#if USE_TCACHE
/* If we've processed as many chunks as we're allowed while
filling the cache, return one of the cached ones. */
- tcache_unsorted_count ++;
+ ++tcache_unsorted_count;
if (return_cached
&& mp_.tcache_unsorted_limit > 0
&& tcache_unsorted_count > mp_.tcache_unsorted_limit)
{
TCacheEntry *e = tcache.entries[tc_idx];
tcache.entries[tc_idx] = e->next;
- tcache.counts[tc_idx] --;
+ --tcache.counts[tc_idx];
return (void *) e;
}
#endif
@@ -3818,7 +3815,7 @@ _int_malloc (mstate av, size_t bytes)
{
TCacheEntry *e = tcache.entries[tc_idx];
tcache.entries[tc_idx] = e->next;
- tcache.counts[tc_idx] --;
+ --tcache.counts[tc_idx];
return (void *) e;
}
#endif
@@ -4119,7 +4116,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
TCacheEntry *e = (TCacheEntry *) chunk2mem (p);
e->next = tcache.entries[tc_idx];
tcache.entries[tc_idx] = e;
- tcache.counts[tc_idx] ++;
+ ++tcache.counts[tc_idx];
return;
}
}
-----------------------------------------------------------------------
Summary of changes:
malloc/malloc.c | 29 +++++++++++++----------------
1 files changed, 13 insertions(+), 16 deletions(-)
hooks/post-receive
--
GNU C Library master sources