changeset 3514:331bfc72ef66 trunk

Convert some things to use GSlice.
author William Pitcock <nenolod@atheme.org>
date Tue, 11 Sep 2007 20:29:53 -0500
parents d74a68871159
children 6d385ae0e97a
files src/audacious/eventqueue.c src/audacious/formatter.c src/audacious/playback.c src/audacious/ui_skinned_playlist.c src/audacious/ui_skinselector.c
diffstat 5 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/eventqueue.c	Tue Sep 11 09:14:15 2007 -0500
+++ b/src/audacious/eventqueue.c	Tue Sep 11 20:29:53 2007 -0500
@@ -27,7 +27,7 @@
     hook_call(hq->name, hq->user_data);
 
     g_free(hq->name);
-    g_free(hq);
+    g_slice_free(HookCallQueue, hq);
 
     return FALSE;
 }
@@ -39,7 +39,7 @@
     g_return_if_fail(name != NULL);
     g_return_if_fail(user_data != NULL);
 
-    hq = g_new0(HookCallQueue, 1);
+    hq = g_slice_new0(HookCallQueue);
     hq->name = g_strdup(name);
     hq->user_data = user_data;
 
--- a/src/audacious/formatter.c	Tue Sep 11 09:14:15 2007 -0500
+++ b/src/audacious/formatter.c	Tue Sep 11 20:29:53 2007 -0500
@@ -40,7 +40,7 @@
 Formatter *
 formatter_new(void)
 {
-    Formatter *formatter = g_new0(Formatter, 1);
+    Formatter *formatter = g_slice_new0(Formatter);
 
     formatter_associate(formatter, '%', "%");
     return formatter;
@@ -60,7 +60,8 @@
     for (i = 0; i < 256; i++)
         if (formatter->values[i])
             g_free(formatter->values[i]);
-    g_free(formatter);
+
+    g_slice_free(Formatter, formatter);
 }
 
 /**
--- a/src/audacious/playback.c	Tue Sep 11 09:14:15 2007 -0500
+++ b/src/audacious/playback.c	Tue Sep 11 20:29:53 2007 -0500
@@ -248,7 +248,7 @@
             g_cond_free(playback->pb_ready_cond);
 
         g_free(playback->filename);
-        g_free(playback);
+        g_slice_free(InputPlayback, playback);
         set_current_input_playback(NULL);
 #ifdef USE_DBUS
         mpris_emit_status_change(mpris, MPRIS_STATUS_STOP);
@@ -343,7 +343,7 @@
 
     ip_data.playing = TRUE;
 
-    playback = g_new0(InputPlayback, 1);
+    playback = g_slice_new0(InputPlayback);
     
     entry->decoder->output = &psuedo_output_plugin;
 
--- a/src/audacious/ui_skinned_playlist.c	Tue Sep 11 09:14:15 2007 -0500
+++ b/src/audacious/ui_skinned_playlist.c	Tue Sep 11 20:29:53 2007 -0500
@@ -455,7 +455,7 @@
     plw_w = playlistwin_get_width();
     plw_h = playlistwin_get_height();
 
-    playlist_rect = g_new0(GdkRectangle, 1);
+    playlist_rect = g_slice_new0(GdkRectangle);
 
     playlist_rect->x = 0;
     playlist_rect->y = 0;
@@ -769,7 +769,7 @@
 
     g_object_unref(obj);
     g_object_unref(gc);
-    g_free(playlist_rect);
+    g_slice_free(GdkRectangle, playlist_rect);
 
     return FALSE;
 }
--- a/src/audacious/ui_skinselector.c	Tue Sep 11 09:14:15 2007 -0500
+++ b/src/audacious/ui_skinselector.c	Tue Sep 11 20:29:53 2007 -0500
@@ -168,7 +168,7 @@
 
     g_return_if_fail(filename != NULL);
 
-    node = g_new0(SkinNode, 1);
+    node = g_slice_new0(SkinNode);
     node->path = g_strdup(filename);
 
     basename = g_path_get_basename(filename);
@@ -232,7 +232,7 @@
     g_return_if_fail(data != NULL);
     g_free(SKIN_NODE(data)->name);
     g_free(SKIN_NODE(data)->path);
-    g_free(data);
+    g_slice_free(SkinNode, data);
 }