plugins/indexers/: Use GSlice when possible.

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.
This commit is contained in:
Sebastian Dröge 2008-04-03 07:52:31 +00:00
parent e583f5a57b
commit cc253fbc60
3 changed files with 18 additions and 8 deletions

View file

@ -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:

View 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);

View 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;