[glib/wip/gcleanup] Cleanup atomic array manually as very last thing



commit 9110d8e4eb798a60ea63d3626ffa8974619382c6
Author: Stef Walter <stefw gnome org>
Date:   Fri Nov 8 22:43:55 2013 +0100

    Cleanup atomic array manually as very last thing
    
    Otherwise we keep putting stuff in freelist during cleanup.

 gobject/gatomicarray.c |   10 ++--------
 gobject/gatomicarray.h |    1 +
 2 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/gobject/gatomicarray.c b/gobject/gatomicarray.c
index 2b71c44..99019fe 100644
--- a/gobject/gatomicarray.c
+++ b/gobject/gatomicarray.c
@@ -85,8 +85,8 @@ freelist_alloc (gsize size, gboolean reuse)
   return mem;
 }
 
-static void
-freelist_cleanup (void)
+void
+_g_atomic_array_cleanup (void)
 {
   FreeListNode *cur, *next;
 
@@ -111,12 +111,6 @@ freelist_free (gpointer mem)
 {
   FreeListNode *free;
 
-  if (freelist == NULL)
-    {
-      g_cleanup_list_push (G_CLEANUP_LIST, (GCleanupFunc)freelist_cleanup, NULL,
-                           G_CLEANUP_PHASE_GRAVEYARD, "freelist_cleanup");
-    }
-
   free = mem;
   free->next = freelist;
   freelist = free;
diff --git a/gobject/gatomicarray.h b/gobject/gatomicarray.h
index 5a6a4db..79a87d8 100644
--- a/gobject/gatomicarray.h
+++ b/gobject/gatomicarray.h
@@ -41,6 +41,7 @@ gpointer _g_atomic_array_copy   (GAtomicArray *array,
                                 gsize         additional_element_size);
 void     _g_atomic_array_update (GAtomicArray *array,
                                 gpointer      new_data);
+void     _g_atomic_array_cleanup(void);
 
 #define  G_ATOMIC_ARRAY_GET_LOCKED(_array, _type) ((_type *)((_array)->data))
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]