mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-02 15:46:17 +01:00
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:
parent
9c9e953440
commit
f2613bf9ed
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user