From: Ryan Lortie Date: Sat, 23 Jan 2010 01:18:58 +0000 (-0500) Subject: BugĀ 448888 - don't init g_slice for always-malloc X-Git-Tag: 2.23.2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8fc3112f910b544ace0e1cb14d47555b38be6d8;p=platform%2Fupstream%2Fglib.git BugĀ 448888 - don't init g_slice for always-malloc --- diff --git a/glib/gslice.c b/glib/gslice.c index 70f9efa..c73884b 100644 --- a/glib/gslice.c +++ b/glib/gslice.c @@ -325,14 +325,24 @@ g_slice_init_nomessage (void) /* we can only align to system page size */ allocator->max_page_size = sys_page_size; #endif + if (allocator->config.always_malloc) + { + allocator->contention_counters = NULL; + allocator->magazines = NULL; + allocator->slab_stack = NULL; + } + else + { + allocator->contention_counters = g_new0 (guint, MAX_SLAB_INDEX (allocator)); + allocator->magazines = g_new0 (ChunkLink*, MAX_SLAB_INDEX (allocator)); + allocator->slab_stack = g_new0 (SlabInfo*, MAX_SLAB_INDEX (allocator)); + } + allocator->magazine_mutex = NULL; /* _g_slice_thread_init_nomessage() */ - allocator->magazines = g_new0 (ChunkLink*, MAX_SLAB_INDEX (allocator)); - allocator->contention_counters = g_new0 (guint, MAX_SLAB_INDEX (allocator)); allocator->mutex_counter = 0; allocator->stamp_counter = MAX_STAMP_COUNTER; /* force initial update */ allocator->last_stamp = 0; allocator->slab_mutex = NULL; /* _g_slice_thread_init_nomessage() */ - allocator->slab_stack = g_new0 (SlabInfo*, MAX_SLAB_INDEX (allocator)); allocator->color_accu = 0; magazine_cache_update_stamp(); /* values cached for performance reasons */