plugins/indexers/: Use GSlice when possible.
authorSebastian Dröge <slomo@circular-chaos.org>
Thu, 3 Apr 2008 07:52:31 +0000 (07:52 +0000)
committerSebastian Dröge <slomo@circular-chaos.org>
Thu, 3 Apr 2008 07:52:31 +0000 (07:52 +0000)
Original commit message from CVS:
* plugins/indexers/gstfileindex.c: (_file_index_id_free),
(gst_file_index_load), (gst_file_index_add_id),
(gst_file_index_get_assoc_entry):
* plugins/indexers/gstmemindex.c: (gst_mem_index_free_format),
(gst_mem_index_free_id), (gst_mem_index_add_id),
(gst_mem_index_index_format):
Use GSlice when possible.

ChangeLog
plugins/indexers/gstfileindex.c
plugins/indexers/gstmemindex.c

index f2eb760..7ba7c1a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-04-03  Sebastian Dröge  <slomo@circular-chaos.org>
+
+       * plugins/indexers/gstfileindex.c: (_file_index_id_free),
+       (gst_file_index_load), (gst_file_index_add_id),
+       (gst_file_index_get_assoc_entry):
+       * plugins/indexers/gstmemindex.c: (gst_mem_index_free_format),
+       (gst_mem_index_free_id), (gst_mem_index_add_id),
+       (gst_mem_index_index_format):
+       Use GSlice when possible.
+
 2008-04-02  Sebastian Dröge  <slomo@circular-chaos.org>
 
        * libs/gst/controller/gstinterpolationcontrolsource.c:
index 36c5401..a90ce36 100644 (file)
@@ -216,7 +216,7 @@ _file_index_id_free (GstFileIndexId * index_id, gboolean is_mmapped)
       munmap (index_id->array->data, ARRAY_TOTAL_SIZE (index_id));
     g_array_free (index_id->array, !is_mmapped);
   }
-  g_free (index_id);
+  g_slice_free (GstFileIndexId, index_id);
 }
 
 static gboolean
@@ -400,7 +400,7 @@ gst_file_index_load (GstFileIndex * index)
           continue;
         }
 
-        id_index = g_new0 (GstFileIndexId, 1);
+        id_index = g_slice_new0 (GstFileIndexId);
         id_index->id_desc = (char *) xmlGetProp (writer, (xmlChar *) "id");
 
         for (wpart = writer->children; wpart; wpart = wpart->next) {
@@ -656,7 +656,7 @@ gst_file_index_add_id (GstIndex * index, GstIndexEntry * entry)
   id_index = g_hash_table_lookup (fileindex->id_index, &entry->id);
 
   if (!id_index) {
-    id_index = g_new0 (GstFileIndexId, 1);
+    id_index = g_slice_new0 (GstFileIndexId);
 
     id_index->id = entry->id;
     id_index->id_desc = g_strdup (entry->data.id.description);
@@ -960,7 +960,7 @@ gst_file_index_get_assoc_entry (GstIndex * index,
 
   /* entry memory management needs improvement FIXME */
   if (!fileindex->ret_entry)
-    fileindex->ret_entry = g_new0 (GstIndexEntry, 1);
+    fileindex->ret_entry = g_slice_new0 (GstIndexEntry);
   entry = fileindex->ret_entry;
   if (entry->data.assoc.assocs) {
     g_free (entry->data.assoc.assocs);
index 4261bb1..ce23bae 100644 (file)
@@ -182,7 +182,7 @@ gst_mem_index_free_format (gpointer key, gpointer value, gpointer user_data)
     g_tree_destroy (index->tree);
   }
 
-  g_free (index);
+  g_slice_free (GstMemIndexFormatIndex, index);
 }
 
 static void
@@ -197,7 +197,7 @@ gst_mem_index_free_id (gpointer key, gpointer value, gpointer user_data)
     id_index->format_index = NULL;
   }
 
-  g_free (id_index);
+  g_slice_free (GstMemIndexId, id_index);
 }
 
 static void
@@ -231,7 +231,7 @@ gst_mem_index_add_id (GstIndex * index, GstIndexEntry * entry)
   id_index = g_hash_table_lookup (memindex->id_index, &entry->id);
 
   if (!id_index) {
-    id_index = g_new0 (GstMemIndexId, 1);
+    id_index = g_slice_new0 (GstMemIndexId);
 
     id_index->id = entry->id;
     id_index->format_index = g_hash_table_new (g_int_hash, g_int_equal);
@@ -266,7 +266,7 @@ gst_mem_index_index_format (GstMemIndexId * id_index, GstIndexEntry * entry,
   index = g_hash_table_lookup (id_index->format_index, format);
 
   if (!index) {
-    index = g_new0 (GstMemIndexFormatIndex, 1);
+    index = g_slice_new0 (GstMemIndexFormatIndex);
 
     index->format = *format;
     index->offset = assoc;