don't reverse chunk order when creating magazines, so we hand out chunks

Wed Jan  4 13:33:25 2006  Tim Janik  <timj@gtk.org>

        * glib/gslice.c (magazine_cache_pop_magazine): don't reverse chunk
        order when creating magazines, so we hand out chunks with ascending
        adresses.
This commit is contained in:
Tim Janik 2006-01-04 13:03:22 +00:00 committed by Tim Janik
parent 9c9e953440
commit f2613bf9ed
4 changed files with 27 additions and 6 deletions

View File

@ -1,3 +1,9 @@
Wed Jan 4 13:33:25 2006 Tim Janik <timj@gtk.org>
* glib/gslice.c (magazine_cache_pop_magazine): don't reverse chunk
order when creating magazines, so we hand out chunks with ascending
adresses.
2006-01-04 Abel Cheung <maddog@linuxhall.org>
* configure.in: Added "ml" "zh_HK" to ALL_LINGUAS.

View File

@ -1,3 +1,9 @@
Wed Jan 4 13:33:25 2006 Tim Janik <timj@gtk.org>
* glib/gslice.c (magazine_cache_pop_magazine): don't reverse chunk
order when creating magazines, so we hand out chunks with ascending
adresses.
2006-01-04 Abel Cheung <maddog@linuxhall.org>
* configure.in: Added "ml" "zh_HK" to ALL_LINGUAS.

View File

@ -1,3 +1,9 @@
Wed Jan 4 13:33:25 2006 Tim Janik <timj@gtk.org>
* glib/gslice.c (magazine_cache_pop_magazine): don't reverse chunk
order when creating magazines, so we hand out chunks with ascending
adresses.
2006-01-04 Abel Cheung <maddog@linuxhall.org>
* configure.in: Added "ml" "zh_HK" to ALL_LINGUAS.

View File

@ -579,19 +579,22 @@ magazine_cache_pop_magazine (guint ix,
{
guint magazine_threshold = allocator_get_magazine_threshold (allocator, ix);
gsize i, chunk_size = SLAB_CHUNK_SIZE (allocator, ix);
ChunkLink *current = NULL;
ChunkLink *chunk, *head;
g_mutex_unlock (allocator->magazine_mutex);
g_mutex_lock (allocator->slab_mutex);
for (i = 0; i < magazine_threshold; i++)
head = slab_allocator_alloc_chunk (chunk_size);
head->data = NULL;
chunk = head;
for (i = 1; i < magazine_threshold; i++)
{
ChunkLink *chunk = slab_allocator_alloc_chunk (chunk_size);
chunk->next = slab_allocator_alloc_chunk (chunk_size);
chunk = chunk->next;
chunk->data = NULL;
chunk->next = current;
current = chunk;
}
chunk->next = NULL;
g_mutex_unlock (allocator->slab_mutex);
*countp = i;
return current;
return head;
}
else
{