[grilo-plugins] [filesystem] Use g_slices when possible



commit 83d6db4ecbb22512c21327c80c712c25095a4595
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Tue Apr 27 12:55:24 2010 +0200

    [filesystem] Use g_slices when possible
    
    Memory slices are more efficient than mallocs.

 src/filesystem/grl-filesystem.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/filesystem/grl-filesystem.c b/src/filesystem/grl-filesystem.c
index 7ad140d..fafeb2e 100644
--- a/src/filesystem/grl-filesystem.c
+++ b/src/filesystem/grl-filesystem.c
@@ -406,7 +406,7 @@ browse_emit_idle (gpointer user_data)
 
   if (!idle_data->current) {
     g_list_free (idle_data->entries);
-    g_free (idle_data);
+    g_slice_free (BrowseIdleData, idle_data);
     return FALSE;
   } else {
     return TRUE;
@@ -475,7 +475,7 @@ produce_from_path (GrlMediaSourceBrowseSpec *bs, const gchar *path)
   /* Emit results */
   if (entries) {
     /* Use the idle loop to avoid blocking for too long */
-    BrowseIdleData *idle_data = g_new (BrowseIdleData, 1);
+    BrowseIdleData *idle_data = g_slice_new (BrowseIdleData);
     idle_data->spec = bs;
     idle_data->remaining = bs->count - count - 1;
     idle_data->path = path;



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