[beast: 45/95] SFI: sfimemory: use Rapicorn::Mutex



commit 662c0d7694168d90dee4ccc7032cea4180a7c57d
Author: Tim Janik <timj gnu org>
Date:   Tue Mar 19 02:01:44 2013 +0100

    SFI: sfimemory: use Rapicorn::Mutex

 sfi/sfimemory.cc |   14 +++-----------
 sfi/sfimemory.hh |    1 -
 2 files changed, 3 insertions(+), 12 deletions(-)
---
diff --git a/sfi/sfimemory.cc b/sfi/sfimemory.cc
index 9a111b8..27a3517 100644
--- a/sfi/sfimemory.cc
+++ b/sfi/sfimemory.cc
@@ -6,7 +6,7 @@
 #define TS8_SIZE                (MAX (sizeof (GTrashStack), 8))
 #define DBG8_SIZE               (MAX (sizeof (gsize), 8))
 /* --- variables --- */
-static BirnetMutex     global_memory_mutex = { 0, };
+static Rapicorn::Mutex global_memory_mutex;
 static GTrashStack *simple_cache[SIMPLE_CACHE_SIZE] = { 0, 0, 0, /* ... */ };
 static gulong       memory_allocated = 0;
 /* --- functions --- */
@@ -116,7 +116,7 @@ void
 sfi_alloc_report (void)
 {
   guint cell, cached = 0;
-  sfi_mutex_lock (&global_memory_mutex);
+  global_memory_mutex.lock();
   for (cell = 0; cell < SIMPLE_CACHE_SIZE; cell++)
     {
       GTrashStack *trash = simple_cache[cell];
@@ -134,7 +134,7 @@ sfi_alloc_report (void)
        }
     }
   g_message ("%lu bytes allocated from system, %u bytes unused in cache", memory_allocated, cached);
-  sfi_mutex_unlock (&global_memory_mutex);
+  global_memory_mutex.unlock();
 }
 gpointer
 sfi_alloc_memblock0 (gsize block_size)
@@ -160,11 +160,3 @@ _sfi_free_node_list (gpointer mem,
     }
   while (node);
 }
-void
-_sfi_init_memory (void)
-{
-  gboolean initialized = FALSE;
-  g_assert (initialized == FALSE);
-  initialized = TRUE;
-  sfi_mutex_init (&global_memory_mutex);
-}
diff --git a/sfi/sfimemory.hh b/sfi/sfimemory.hh
index 94d1cd9..291910e 100644
--- a/sfi/sfimemory.hh
+++ b/sfi/sfimemory.hh
@@ -27,7 +27,6 @@ void            sfi_alloc_report        (void);
 gulong         sfi_alloc_upper_power2  (const gulong    number);
 void           _sfi_free_node_list     (gpointer        mem,
                                         gsize           node_size);
-void           _sfi_init_memory        (void);
 G_END_DECLS
 #endif /* __SFI_MEMORY_H__ */
 /* vim:set ts=8 sts=2 sw=2: */


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