]> Dogcows Code - chaz/openbox/commitdiff
more using g_slice_new() instead of g_new()
authorDana Jansens <danakj@orodu.net>
Tue, 16 Feb 2010 21:26:18 +0000 (16:26 -0500)
committerDana Jansens <danakj@orodu.net>
Tue, 16 Feb 2010 21:32:38 +0000 (16:32 -0500)
31 files changed:
obrender/theme.c
obt/mainloop.c
obt/paths.c
obt/xevent.c
openbox/actions/addremovedesktop.c
openbox/actions/cyclewindows.c
openbox/actions/debug.c
openbox/actions/desktop.c
openbox/actions/directionalwindows.c
openbox/actions/exit.c
openbox/actions/focus.c
openbox/actions/growtoedge.c
openbox/actions/if.c
openbox/actions/layer.c
openbox/actions/maximize.c
openbox/actions/moverelative.c
openbox/actions/moveresizeto.c
openbox/actions/movetoedge.c
openbox/actions/resize.c
openbox/actions/resizerelative.c
openbox/actions/restart.c
openbox/actions/showmenu.c
openbox/config.c
openbox/dock.c
openbox/frame.c
openbox/keytree.c
openbox/menu.c
openbox/menuframe.c
openbox/mouse.c
openbox/ping.c
openbox/prompt.c

index 43fb0dd1e95bf167c4848d5629bdfeb6f93f2f46..dfd79985def0e2767b62bade9ac32cde8a269387 100644 (file)
@@ -99,7 +99,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
             return NULL;
     }
 
-    theme = g_new0(RrTheme, 1);
+    theme = g_slice_new0(RrTheme);
 
     theme->inst = inst;
     theme->name = g_strdup(name ? name : DEFAULT_THEME);
@@ -1658,7 +1658,7 @@ void RrThemeFree(RrTheme *theme)
         RrAppearanceFree(theme->osd_unhilite_bg);
         RrAppearanceFree(theme->osd_unhilite_label);
 
-        g_free(theme);
+        g_slice_free(RrTheme, theme);
     }
 }
 
index c0b9bb597e92922d0a5823ea25144e7a847fd096..ecdd7f7f535fdfafeb265884dbb79cf5ca32dbfb 100644 (file)
@@ -155,7 +155,7 @@ ObtMainLoop *obt_main_loop_new(void)
 {
     ObtMainLoop *loop;
 
-    loop = g_new0(ObtMainLoop, 1);
+    loop = g_slice_new0(ObtMainLoop);
     loop->ref = 1;
     FD_ZERO(&loop->fd_set);
     loop->fd_x = -1;
@@ -249,7 +249,7 @@ void obt_main_loop_unref(ObtMainLoop *loop)
             }
         }
 
-        obt_free0(loop, ObtMainLoop, 1);
+        g_slice_free(ObtMainLoop, loop);
     }
 }
 
index 68615433e1d9426dc58cdf462050cbe89937cf6c..da6f288bf6cf9fd62abca6bedf02c279ff7b6bba 100644 (file)
@@ -80,7 +80,7 @@ ObtPaths* obt_paths_new(void)
     ObtPaths *p;
     const gchar *path;
 
-    p = g_new0(ObtPaths, 1);
+    p = g_slice_new0(ObtPaths);
     p->ref = 1;
 
     path = g_getenv("XDG_CONFIG_HOME");
@@ -163,7 +163,7 @@ void obt_paths_unref(ObtPaths *p)
         g_free(p->data_home);
         g_free(p->cache_home);
 
-        obt_free0(p, ObtPaths, 1);
+        g_slice_free(ObtPaths, p);
     }
 }
 
index 21beb9301b40218a810998ce8653c4713b561b90..1077165766935301c2ac0551491c92d9dd2c6b53 100644 (file)
@@ -49,7 +49,7 @@ ObtXEventHandler* xevent_new(void)
 {
     ObtXEventHandler *h;
 
-    h = g_new0(ObtXEventHandler, 1);
+    h = g_slice_new0(ObtXEventHandler);
     h->ref = 1;
 
     return h;
@@ -71,7 +71,7 @@ void xevent_unref(ObtXEventHandler *h)
             g_hash_table_destroy(h->bindings[i]);
         g_free(h->bindings);
 
-        obt_free0(h, ObtXEventHandler, 1);
+        g_slice_free(ObtXEventHandler, h);
     }
 }
 
index e21e9e663071f25fc4ef07f9817a24a09da8888d..ff6767e29423a14eab5ec46ea102f8e6ee422cd0 100644 (file)
@@ -10,6 +10,7 @@ typedef struct {
 static gpointer setup_func(xmlNodePtr node);
 static gpointer setup_add_func(xmlNodePtr node);
 static gpointer setup_remove_func(xmlNodePtr node);
+static void free_func(gpointer o);
 static gboolean run_func(ObActionsData *data, gpointer options);
 /* 3.4-compatibility */
 static gpointer setup_addcurrent_func(xmlNodePtr node);
@@ -19,17 +20,18 @@ static gpointer setup_removelast_func(xmlNodePtr node);
 
 void action_addremovedesktop_startup(void)
 {
-    actions_register("AddDesktop", setup_add_func, g_free, run_func);
-    actions_register("RemoveDesktop", setup_remove_func, g_free, run_func);
+    actions_register("AddDesktop", setup_add_func, free_func, run_func);
+    actions_register("RemoveDesktop", setup_remove_func, free_func, run_func);
 
     /* 3.4-compatibility */
-    actions_register("AddDesktopLast", setup_addlast_func, g_free, run_func);
+    actions_register("AddDesktopLast", setup_addlast_func,
+                     free_func, run_func);
     actions_register("RemoveDesktopLast", setup_removelast_func,
-                     g_free, run_func);
+                     free_func, run_func);
     actions_register("AddDesktopCurrent", setup_addcurrent_func,
-                     g_free, run_func);
+                     free_func, run_func);
     actions_register("RemoveDesktopCurrent", setup_removecurrent_func,
-                     g_free, run_func);
+                     free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node)
@@ -37,7 +39,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
 
     if ((n = obt_xml_find_node(node, "where"))) {
         gchar *s = obt_xml_node_string(n);
@@ -65,6 +67,11 @@ static gpointer setup_remove_func(xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
index 52349091f8954689796212bf074e7de57d5509f5..a038f31aaac29f876d013525327f08cdf870b881 100644 (file)
@@ -65,7 +65,7 @@ static gpointer setup_func(xmlNodePtr node,
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
     o->bar = TRUE;
     o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_LIST;
 
@@ -144,7 +144,7 @@ static void free_func(gpointer options)
         o->actions = g_slist_delete_link(o->actions, o->actions);
     }
 
-    g_free(o);
+    g_slice_free(Options, o);
 }
 
 static gboolean run_func(ObActionsData *data, gpointer options)
index 9ba7b1b0db4393266c9584c6b04826b2514e3411..99446bc471a9e74fdb35ad95e294a9cc43f69102 100644 (file)
@@ -19,7 +19,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
 
     if ((n = obt_xml_find_node(node, "string")))
         o->str = obt_xml_node_string(n);
@@ -30,7 +30,7 @@ static void free_func(gpointer options)
 {
     Options *o = options;
     g_free(o->str);
-    g_free(o);
+    g_slice_free(Options, o);
 }
 
 /* Always return FALSE because its not interactive */
index 6c30d56de3fb9e28df54e36d4bc358c8083a2bb0..10b31acd535c9fc6b086e106a8a007a312333b71 100644 (file)
@@ -38,6 +38,7 @@ static gpointer setup_send_func(xmlNodePtr node,
                                 ObActionsIInputFunc *input,
                                 ObActionsICancelFunc *cancel,
                                 ObActionsIPostFunc *post);
+static void free_func(gpointer o);
 static gboolean run_func(ObActionsData *data, gpointer options);
 
 static gboolean i_pre_func(guint state, gpointer options);
@@ -113,36 +114,38 @@ static gpointer setup_send_down_func(xmlNodePtr node,
                                      ObActionsIInputFunc *input,
                                      ObActionsICancelFunc *cancel,
                                      ObActionsIPostFunc *post);
+
 void action_desktop_startup(void)
 {
-    actions_register_i("GoToDesktop", setup_go_func, g_free, run_func);
-    actions_register_i("SendToDesktop", setup_send_func, g_free, run_func);
+    actions_register_i("GoToDesktop", setup_go_func, free_func, run_func);
+    actions_register_i("SendToDesktop", setup_send_func, free_func, run_func);
     /* 3.4-compatibility */
-    actions_register("DesktopLast", setup_go_last_func, g_free, run_func);
+    actions_register("DesktopLast", setup_go_last_func, free_func, run_func);
     actions_register("SendToDesktopLast", setup_send_last_func,
-                     g_free, run_func);
-    actions_register("Desktop", setup_go_abs_func, g_free, run_func);
-    actions_register("SendToDesktop", setup_send_abs_func, g_free, run_func);
-    actions_register_i("DesktopNext", setup_go_next_func, g_free, run_func);
+                     free_func, run_func);
+    actions_register("Desktop", setup_go_abs_func, free_func, run_func);
+    actions_register("SendToDesktop", setup_send_abs_func,
+                     free_func, run_func);
+    actions_register_i("DesktopNext", setup_go_next_func, free_func, run_func);
     actions_register_i("SendToDesktopNext", setup_send_next_func,
-                       g_free, run_func);
+                       free_func, run_func);
     actions_register_i("DesktopPrevious", setup_go_prev_func,
-                       g_free, run_func);
+                       free_func, run_func);
     actions_register_i("SendToDesktopPrevious", setup_send_prev_func,
-                       g_free, run_func);
-    actions_register_i("DesktopLeft", setup_go_left_func, g_free, run_func);
+                       free_func, run_func);
+    actions_register_i("DesktopLeft", setup_go_left_func, free_func, run_func);
     actions_register_i("SendToDesktopLeft", setup_send_left_func,
-                       g_free, run_func);
-    actions_register_i("DesktopRight", setup_go_right_func, g_free, run_func);
+                       free_func, run_func);
+    actions_register_i("DesktopRight", setup_go_right_func,
+                       free_func, run_func);
     actions_register_i("SendToDesktopRight", setup_send_right_func,
-                       g_free, run_func);
-    actions_register_i("DesktopUp", setup_go_up_func, g_free, run_func);
+                       free_func, run_func);
+    actions_register_i("DesktopUp", setup_go_up_func, free_func, run_func);
     actions_register_i("SendToDesktopUp", setup_send_up_func,
-                       g_free, run_func);
-    actions_register_i("DesktopDown", setup_go_down_func, g_free, run_func);
+                       free_func, run_func);
+    actions_register_i("DesktopDown", setup_go_down_func, free_func, run_func);
     actions_register_i("SendToDesktopDown", setup_send_down_func,
-                       g_free, run_func);
+                       free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node,
@@ -154,7 +157,7 @@ static gpointer setup_func(xmlNodePtr node,
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
     /* don't go anywhere if there are no options given */
     o->type = ABSOLUTE;
     o->u.abs.desktop = screen_desktop;
@@ -254,6 +257,11 @@ static gpointer setup_send_func(xmlNodePtr node,
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
@@ -353,7 +361,7 @@ static void i_post_func(gpointer options)
 static gpointer setup_follow(xmlNodePtr node)
 {
     xmlNodePtr n;
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->send = TRUE;
     o->follow = TRUE;
     if ((n = obt_xml_find_node(node, "follow")))
@@ -363,7 +371,7 @@ static gpointer setup_follow(xmlNodePtr node)
 
 static gpointer setup_go_last_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->type = LAST;
     return o;
 }
@@ -378,7 +386,7 @@ static gpointer setup_send_last_func(xmlNodePtr node)
 static gpointer setup_go_abs_func(xmlNodePtr node)
 {
     xmlNodePtr n;
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->type = ABSOLUTE;
     if ((n = obt_xml_find_node(node, "desktop")))
         o->u.abs.desktop = obt_xml_node_int(n) - 1;
@@ -429,7 +437,7 @@ static gpointer setup_go_next_func(xmlNodePtr node,
                                    ObActionsICancelFunc *cancel,
                                    ObActionsIPostFunc *post)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     setup_rel(o, node, TRUE, OB_DIRECTION_EAST, pre, input, post);
     return o;
 }
@@ -452,7 +460,7 @@ static gpointer setup_go_prev_func(xmlNodePtr node,
                                    ObActionsICancelFunc *cancel,
                                    ObActionsIPostFunc *post)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     setup_rel(o, node, TRUE, OB_DIRECTION_WEST, pre, input, post);
     return o;
 }
@@ -475,7 +483,7 @@ static gpointer setup_go_left_func(xmlNodePtr node,
                                    ObActionsICancelFunc *cancel,
                                    ObActionsIPostFunc *post)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     setup_rel(o, node, FALSE, OB_DIRECTION_WEST, pre, input, post);
     return o;
 }
@@ -498,7 +506,7 @@ static gpointer setup_go_right_func(xmlNodePtr node,
                                     ObActionsICancelFunc *cancel,
                                     ObActionsIPostFunc *post)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     setup_rel(o, node, FALSE, OB_DIRECTION_EAST, pre, input, post);
     return o;
 }
@@ -521,7 +529,7 @@ static gpointer setup_go_up_func(xmlNodePtr node,
                                  ObActionsICancelFunc *cancel,
                                  ObActionsIPostFunc *post)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     setup_rel(o, node, FALSE, OB_DIRECTION_NORTH, pre, input, post);
     return o;
 }
@@ -544,7 +552,7 @@ static gpointer setup_go_down_func(xmlNodePtr node,
                                    ObActionsICancelFunc *cancel,
                                    ObActionsIPostFunc *post)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     setup_rel(o, node, FALSE, OB_DIRECTION_SOUTH, pre, input, post);
     return o;
 }
index 7ede33339314e948cc8f615ed944f0533e33b318..f8393d2d9b035ca074b95440a32a8f0e70a63e1d 100644 (file)
@@ -135,7 +135,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
     o->dialog = TRUE;
     o->bar = TRUE;
 
@@ -225,7 +225,7 @@ static void free_func(gpointer options)
         o->actions = g_slist_delete_link(o->actions, o->actions);
     }
 
-    g_free(o);
+    g_slice_free(Options, o);
 }
 
 static gboolean run_func(ObActionsData *data, gpointer options)
index f2b0cafbfafa0977ed9bb7c508c4114191218034..2d9fc63312dc9c73b196474db71fb0f79bd99f83 100644 (file)
@@ -9,12 +9,13 @@ typedef struct {
 } Options;
 
 static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
 static gboolean run_func(ObActionsData *data, gpointer options);
 
 void action_exit_startup(void)
 {
-    actions_register("Exit", setup_func, NULL, run_func);
-    actions_register("SessionLogout", setup_func, NULL, run_func);
+    actions_register("Exit", setup_func, free_func, run_func);
+    actions_register("SessionLogout", setup_func, free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node)
@@ -22,7 +23,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
     o->prompt = TRUE;
 
     if ((n = obt_xml_find_node(node, "prompt")))
@@ -31,6 +32,11 @@ static gpointer setup_func(xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 static void do_exit(void)
 {
     if (session_connected())
@@ -51,6 +57,7 @@ static void prompt_cleanup(ObPrompt *p, gpointer data)
     prompt_unref(p);
 }
 
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
index 8bae49c7a1aaf0778aa142d789f4a43b0366682f..6c8957c81eca6370814f35a86abe42834b280d1e 100644 (file)
@@ -10,11 +10,12 @@ typedef struct {
 } Options;
 
 static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
 static gboolean run_func(ObActionsData *data, gpointer options);
 
 void action_focus_startup(void)
 {
-    actions_register("Focus", setup_func, g_free, run_func);
+    actions_register("Focus", setup_func, free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node)
@@ -22,7 +23,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
     o->stop_int = TRUE;
 
     if ((n = obt_xml_find_node(node, "here")))
@@ -32,6 +33,11 @@ static gpointer setup_func(xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
index 9589d3f6498aedd6a80a923fb2da3ef214ea07a5..d5a7bfdd9e8a30c476dcf2203c45aa8f189e3dc3 100644 (file)
@@ -12,6 +12,7 @@ typedef struct {
 
 static gpointer setup_func(xmlNodePtr node);
 static gpointer setup_shrink_func(xmlNodePtr node);
+static void free_func(gpointer o);
 static gboolean run_func(ObActionsData *data, gpointer options);
 /* 3.4-compatibility */
 static gpointer setup_north_func(xmlNodePtr node);
@@ -22,14 +23,14 @@ static gpointer setup_west_func(xmlNodePtr node);
 void action_growtoedge_startup(void)
 {
     actions_register("GrowToEdge", setup_func,
-                     g_free, run_func);
+                     free_func, run_func);
     actions_register("ShrinkToEdge", setup_shrink_func,
-                     g_free, run_func);
+                     free_func, run_func);
     /* 3.4-compatibility */
-    actions_register("GrowToEdgeNorth", setup_north_func, g_free, run_func);
-    actions_register("GrowToEdgeSouth", setup_south_func, g_free, run_func);
-    actions_register("GrowToEdgeEast", setup_east_func, g_free, run_func);
-    actions_register("GrowToEdgeWest", setup_west_func, g_free, run_func);
+    actions_register("GrowToEdgeNorth", setup_north_func, free_func, run_func);
+    actions_register("GrowToEdgeSouth", setup_south_func, free_func, run_func);
+    actions_register("GrowToEdgeEast", setup_east_func, free_func, run_func);
+    actions_register("GrowToEdgeWest", setup_west_func, free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node)
@@ -37,7 +38,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
     o->dir = OB_DIRECTION_NORTH;
     o->shrink = FALSE;
 
@@ -96,6 +97,11 @@ static gboolean do_grow(ObActionsData *data, gint x, gint y, gint w, gint h)
     return FALSE;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
@@ -163,7 +169,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
 /* 3.4-compatibility */
 static gpointer setup_north_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->shrink = FALSE;
     o->dir = OB_DIRECTION_NORTH;
     return o;
@@ -171,7 +177,7 @@ static gpointer setup_north_func(xmlNodePtr node)
 
 static gpointer setup_south_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->shrink = FALSE;
     o->dir = OB_DIRECTION_SOUTH;
     return o;
@@ -179,7 +185,7 @@ static gpointer setup_south_func(xmlNodePtr node)
 
 static gpointer setup_east_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->shrink = FALSE;
     o->dir = OB_DIRECTION_EAST;
     return o;
@@ -187,7 +193,7 @@ static gpointer setup_east_func(xmlNodePtr node)
 
 static gpointer setup_west_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->shrink = FALSE;
     o->dir = OB_DIRECTION_WEST;
     return o;
index dd86086ba9cb29bbe2653721ebde39dd6e8d055a..5f4a356f8d121d644363dc16dde8e6b46614454f 100644 (file)
@@ -37,7 +37,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
 
     if ((n = obt_xml_find_node(node, "shaded"))) {
         if (obt_xml_node_bool(n))
@@ -113,7 +113,7 @@ static void free_func(gpointer options)
         o->elseacts = g_slist_delete_link(o->elseacts, o->elseacts);
     }
 
-    g_free(o);
+    g_slice_free(Options, o);
 }
 
 /* Always return FALSE because its not interactive */
index 2b4d325a49b37e0aaa4673102c971a0db6f2dd39..ed1eeedc0462c26ed22557edbeb39ef028b4c61e 100644 (file)
@@ -9,6 +9,7 @@ typedef struct {
 static gpointer setup_func_top(xmlNodePtr node);
 static gpointer setup_func_bottom(xmlNodePtr node);
 static gpointer setup_func_send(xmlNodePtr node);
+static void free_func(gpointer o);
 static gboolean run_func(ObActionsData *data, gpointer options);
 /* 3.4-compatibility */
 static gpointer setup_sendtop_func(xmlNodePtr node);
@@ -17,24 +18,24 @@ static gpointer setup_sendnormal_func(xmlNodePtr node);
 
 void action_layer_startup(void)
 {
-    actions_register("ToggleAlwaysOnTop", setup_func_top, g_free,
+    actions_register("ToggleAlwaysOnTop", setup_func_top, free_func,
                      run_func);
-    actions_register("ToggleAlwaysOnBottom", setup_func_bottom, g_free,
+    actions_register("ToggleAlwaysOnBottom", setup_func_bottom, free_func,
                      run_func);
-    actions_register("SendToLayer", setup_func_send, g_free,
+    actions_register("SendToLayer", setup_func_send, free_func,
                      run_func);
     /* 3.4-compatibility */
-    actions_register("SendToTopLayer", setup_sendtop_func, g_free,
+    actions_register("SendToTopLayer", setup_sendtop_func, free_func,
                      run_func);
-    actions_register("SendToBottomLayer", setup_sendbottom_func, g_free,
+    actions_register("SendToBottomLayer", setup_sendbottom_func, free_func,
                      run_func);
-    actions_register("SendToNormalLayer", setup_sendnormal_func, g_free,
+    actions_register("SendToNormalLayer", setup_sendnormal_func, free_func,
                      run_func);
 }
 
 static gpointer setup_func_top(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->layer = 1;
     o->toggle = TRUE;
     return o;
@@ -42,7 +43,7 @@ static gpointer setup_func_top(xmlNodePtr node)
 
 static gpointer setup_func_bottom(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->layer = -1;
     o->toggle = TRUE;
     return o;
@@ -53,7 +54,7 @@ static gpointer setup_func_send(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
 
     if ((n = obt_xml_find_node(node, "layer"))) {
         gchar *s = obt_xml_node_string(n);
@@ -72,6 +73,11 @@ static gpointer setup_func_send(xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
@@ -102,7 +108,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
 /* 3.4-compatibility */
 static gpointer setup_sendtop_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->layer = 1;
     o->toggle = FALSE;
     return o;
@@ -110,7 +116,7 @@ static gpointer setup_sendtop_func(xmlNodePtr node)
 
 static gpointer setup_sendbottom_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->layer = -1;
     o->toggle = FALSE;
     return o;
@@ -118,7 +124,7 @@ static gpointer setup_sendbottom_func(xmlNodePtr node)
 
 static gpointer setup_sendnormal_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->layer = 0;
     o->toggle = FALSE;
     return o;
index 4c615078fb16633461d356f13791d34f9098107f..db7c36bb8aaebb9fd9d47a7eea41768bb40d5662 100644 (file)
@@ -13,6 +13,7 @@ typedef struct {
 } Options;
 
 static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
 static gboolean run_func_on(ObActionsData *data, gpointer options);
 static gboolean run_func_off(ObActionsData *data, gpointer options);
 static gboolean run_func_toggle(ObActionsData *data, gpointer options);
@@ -23,27 +24,27 @@ static gpointer setup_vert_func(xmlNodePtr node);
 
 void action_maximize_startup(void)
 {
-    actions_register("Maximize", setup_func, g_free, run_func_on);
-    actions_register("Unmaximize", setup_func, g_free, run_func_off);
-    actions_register("ToggleMaximize", setup_func, g_free, run_func_toggle);
+    actions_register("Maximize", setup_func, free_func, run_func_on);
+    actions_register("Unmaximize", setup_func, free_func, run_func_off);
+    actions_register("ToggleMaximize", setup_func, free_func, run_func_toggle);
     /* 3.4-compatibility */
-    actions_register("MaximizeFull", setup_both_func, g_free,
+    actions_register("MaximizeFull", setup_both_func, free_func,
                      run_func_on);
-    actions_register("UnmaximizeFull", setup_both_func, g_free,
+    actions_register("UnmaximizeFull", setup_both_func, free_func,
                      run_func_off);
-    actions_register("ToggleMaximizeFull", setup_both_func, g_free,
+    actions_register("ToggleMaximizeFull", setup_both_func, free_func,
                      run_func_toggle);
-    actions_register("MaximizeHorz", setup_horz_func, g_free,
+    actions_register("MaximizeHorz", setup_horz_func, free_func,
                      run_func_on);
-    actions_register("UnmaximizeHorz", setup_horz_func, g_free,
+    actions_register("UnmaximizeHorz", setup_horz_func, free_func,
                      run_func_off);
-    actions_register("ToggleMaximizeHorz", setup_horz_func, g_free,
+    actions_register("ToggleMaximizeHorz", setup_horz_func, free_func,
                      run_func_toggle);
-    actions_register("MaximizeVert", setup_vert_func, g_free,
+    actions_register("MaximizeVert", setup_vert_func, free_func,
                      run_func_on);
-    actions_register("UnmaximizeVert", setup_vert_func, g_free,
+    actions_register("UnmaximizeVert", setup_vert_func, free_func,
                      run_func_off);
-    actions_register("ToggleMaximizeVert", setup_vert_func, g_free,
+    actions_register("ToggleMaximizeVert", setup_vert_func, free_func,
                      run_func_toggle);
 }
 
@@ -52,7 +53,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
     o->dir = BOTH;
 
     if ((n = obt_xml_find_node(node, "direction"))) {
@@ -69,6 +70,11 @@ static gpointer setup_func(xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func_on(ObActionsData *data, gpointer options)
 {
@@ -113,21 +119,21 @@ static gboolean run_func_toggle(ObActionsData *data, gpointer options)
 /* 3.4-compatibility */
 static gpointer setup_both_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->dir = BOTH;
     return o;
 }
 
 static gpointer setup_horz_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->dir = HORZ;
     return o;
 }
 
 static gpointer setup_vert_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->dir = VERT;
     return o;
 }
index ff9f719b98e6e9f335fd98ff2129d4709c0ee0bc..189b4dd0d7c4bc59497ac7584fa8b2a106d6fe64 100644 (file)
@@ -10,11 +10,12 @@ typedef struct {
 } Options;
 
 static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
 static gboolean run_func(ObActionsData *data, gpointer options);
 
 void action_moverelative_startup(void)
 {
-    actions_register("MoveRelative", setup_func, g_free, run_func);
+    actions_register("MoveRelative", setup_func, free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node)
@@ -22,7 +23,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
 
     if ((n = obt_xml_find_node(node, "x")))
         o->x = obt_xml_node_int(n);
@@ -32,6 +33,11 @@ static gpointer setup_func(xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
index 68b4c0b2a9c579ca78e1b03987fd08dc714b058a..ce50e9b902b65f446c9f64dff7725824a549ace9 100644 (file)
@@ -24,15 +24,16 @@ typedef struct {
 } Options;
 
 static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
 static gboolean run_func(ObActionsData *data, gpointer options);
 /* 3.4-compatibility */
 static gpointer setup_center_func(xmlNodePtr node);
 
 void action_moveresizeto_startup(void)
 {
-    actions_register("MoveResizeTo", setup_func, g_free, run_func);
+    actions_register("MoveResizeTo", setup_func, free_func, run_func);
     /* 3.4-compatibility */
-    actions_register("MoveToCenter", setup_center_func, g_free, run_func);
+    actions_register("MoveToCenter", setup_center_func, free_func, run_func);
 }
 
 static void parse_coord(xmlNodePtr n, gint *pos,
@@ -59,7 +60,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
     o->x = G_MININT;
     o->y = G_MININT;
     o->w = G_MININT;
@@ -103,6 +104,11 @@ static gpointer setup_func(xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
@@ -186,7 +192,7 @@ static gpointer setup_center_func(xmlNodePtr node)
 {
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
     o->x = G_MININT;
     o->y = G_MININT;
     o->w = G_MININT;
index f81ded41e0ee8a405f4b4c439e00c8f8e20b0947..ef5b69201f54f8229cb0a4e7c0ffabe347569b93 100644 (file)
@@ -10,6 +10,7 @@ typedef struct {
 } Options;
 
 static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
 static gboolean run_func(ObActionsData *data, gpointer options);
 /* 3.4-compatibility */
 static gpointer setup_north_func(xmlNodePtr node);
@@ -19,12 +20,12 @@ static gpointer setup_west_func(xmlNodePtr node);
 
 void action_movetoedge_startup(void)
 {
-    actions_register("MoveToEdge", setup_func, g_free, run_func);
+    actions_register("MoveToEdge", setup_func, free_func, run_func);
     /* 3.4-compatibility */
-    actions_register("MoveToEdgeNorth", setup_north_func, g_free, run_func);
-    actions_register("MoveToEdgeSouth", setup_south_func, g_free, run_func);
-    actions_register("MoveToEdgeEast", setup_east_func, g_free, run_func);
-    actions_register("MoveToEdgeWest", setup_west_func, g_free, run_func);
+    actions_register("MoveToEdgeNorth", setup_north_func, free_func, run_func);
+    actions_register("MoveToEdgeSouth", setup_south_func, free_func, run_func);
+    actions_register("MoveToEdgeEast", setup_east_func, free_func, run_func);
+    actions_register("MoveToEdgeWest", setup_west_func, free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node)
@@ -32,7 +33,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
     o->dir = OB_DIRECTION_NORTH;
 
     if ((n = obt_xml_find_node(node, "direction"))) {
@@ -55,6 +56,11 @@ static gpointer setup_func(xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
@@ -77,28 +83,28 @@ static gboolean run_func(ObActionsData *data, gpointer options)
 /* 3.4-compatibility */
 static gpointer setup_north_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->dir = OB_DIRECTION_NORTH;
     return o;
 }
 
 static gpointer setup_south_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->dir = OB_DIRECTION_SOUTH;
     return o;
 }
 
 static gpointer setup_east_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->dir = OB_DIRECTION_EAST;
     return o;
 }
 
 static gpointer setup_west_func(xmlNodePtr node)
 {
-    Options *o = g_new0(Options, 1);
+    Options *o = g_slice_new0(Options);
     o->dir = OB_DIRECTION_WEST;
     return o;
 }
index fbcdf24a6b3a7d32c16798c58b946e977bdf7504..f6858d2d2046edf6667bb94aa319f05dd08ce534 100644 (file)
@@ -10,6 +10,7 @@ typedef struct {
 } Options;
 
 static gpointer setup_func(xmlNodePtr node);
+static void free_func(gpointer o);
 static gboolean run_func(ObActionsData *data, gpointer options);
 
 static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch,
@@ -17,7 +18,7 @@ static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch,
 
 void action_resize_startup(void)
 {
-    actions_register("Resize", setup_func, g_free, run_func);
+    actions_register("Resize", setup_func, free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node)
@@ -25,7 +26,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
 
     if ((n = obt_xml_find_node(node, "edge"))) {
         gchar *s = obt_xml_node_string(n);
@@ -55,6 +56,11 @@ static gpointer setup_func(xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
index c5fc1ea1cb5b8e91bd418f7aef5d8ee5b2732ab4..1d42df2399e42e28123758c9bb60d9cc12fcabb0 100644 (file)
@@ -12,11 +12,12 @@ typedef struct {
 } Options;
 
 static gpointer setup_func(xmlNodePtr node);
+static void     free_func(gpointer options);
 static gboolean run_func(ObActionsData *data, gpointer options);
 
 void action_resizerelative_startup(void)
 {
-    actions_register("ResizeRelative", setup_func, g_free, run_func);
+    actions_register("ResizeRelative", setup_func, free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node)
@@ -24,7 +25,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
 
     if ((n = obt_xml_find_node(node, "left")))
         o->left = obt_xml_node_int(n);
@@ -40,6 +41,11 @@ static gpointer setup_func(xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer o)
+{
+    g_slice_free(Options, o);
+}
+
 /* Always return FALSE because its not interactive */
 static gboolean run_func(ObActionsData *data, gpointer options)
 {
index 7d1689cbd2450b6abc8942e20369e4048dbf3e68..dc9a218a6985b69c437020b9cdd7182351868bb5 100644 (file)
@@ -20,7 +20,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
 
     if ((n = obt_xml_find_node(node, "command")) ||
         (n = obt_xml_find_node(node, "execute")))
@@ -36,7 +36,7 @@ static void free_func(gpointer options)
 {
     Options *o = options;
     g_free(o->cmd);
-    g_free(o);
+    g_slice_free(Options, o);
 }
 
 /* Always return FALSE because its not interactive */
index e60f1c69e4fd280e0a856c24d3e6cc11a9132716..485a31d5a7e06880eee48d0f1f6aef512db13911 100644 (file)
@@ -20,7 +20,7 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
 
     if ((n = obt_xml_find_node(node, "menu")))
         o->name = obt_xml_node_string(n);
@@ -31,7 +31,7 @@ static void free_func(gpointer options)
 {
     Options *o = options;
     g_free(o->name);
-    g_free(o);
+    g_slice_free(Options, o);
 }
 
 /* Always return FALSE because its not interactive */
index e7a2440b903c384fcd5fb504d596739db7f6b0b7..94ff1d7c8ad34b46358ac335fb57045b53fe5ef9 100644 (file)
@@ -106,7 +106,7 @@ GSList *config_per_app_settings;
 
 ObAppSettings* config_create_app_settings(void)
 {
-    ObAppSettings *settings = g_new0(ObAppSettings, 1);
+    ObAppSettings *settings = g_slice_new0(ObAppSettings);
     settings->type = -1;
     settings->decor = -1;
     settings->shade = -1;
@@ -239,7 +239,7 @@ static void parse_per_app_settings(xmlNodePtr node, gpointer d)
 
         if (class_set || name_set || role_set || title_set || type_set) {
             xmlNodePtr n, c;
-            ObAppSettings *settings = config_create_app_settings();;
+            ObAppSettings *settings = config_create_app_settings();
 
             if (name_set)
                 settings->name = g_pattern_spec_new(name);
@@ -1084,7 +1084,7 @@ void config_shutdown(void)
         if (itd->role)  g_pattern_spec_free(itd->role);
         if (itd->title) g_pattern_spec_free(itd->title);
         if (itd->class) g_pattern_spec_free(itd->class);
-        g_free(it->data);
+        g_slice_free(ObAppSettings, it->data);
     }
     g_slist_free(config_per_app_settings);
 }
index 03db8e9e78df726e021ac2f6d785f049cf415b98..e3ad2bc63060ee6c19fdcd523d78c62085466a2a 100644 (file)
@@ -80,7 +80,7 @@ void dock_startup(gboolean reconfig)
     STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, 0,
                       0, 0, 0, 0, 0, 0, 0, 0);
 
-    dock = g_new0(ObDock, 1);
+    dock = g_slice_new0(ObDock);
     dock->obwin.type = OB_WINDOW_CLASS_DOCK;
 
     dock->hidden = TRUE;
@@ -129,6 +129,8 @@ void dock_shutdown(gboolean reconfig)
     RrAppearanceFree(dock->a_frame);
     window_remove(dock->frame);
     stacking_remove(dock);
+    g_slice_free(ObDock, dock);
+    dock = NULL;
 }
 
 void dock_manage(Window icon_win, Window name_win)
@@ -137,7 +139,7 @@ void dock_manage(Window icon_win, Window name_win)
     XWindowAttributes attrib;
     gchar **data;
 
-    app = g_new0(ObDockApp, 1);
+    app = g_slice_new0(ObDockApp);
     app->name_win = name_win;
     app->icon_win = icon_win;
 
@@ -224,7 +226,7 @@ void dock_unmanage(ObDockApp *app, gboolean reparent)
 
     g_free(app->name);
     g_free(app->class);
-    g_free(app);
+    g_slice_free(ObDockApp, app);
 }
 
 void dock_configure(void)
index a6bfaefeeb566b642ba1920dd3da1ef19c814a8b..f6304f5d1340651006fe202dc3e453c715519ce1 100644 (file)
@@ -89,7 +89,7 @@ ObFrame *frame_new(ObClient *client)
     ObFrame *self;
     Visual *visual;
 
-    self = g_new0(ObFrame, 1);
+    self = g_slice_new0(ObFrame);
     self->client = client;
 
     visual = check_32bit_client(client);
@@ -229,7 +229,7 @@ void frame_free(ObFrame *self)
     if (self->colormap)
         XFreeColormap(obt_display, self->colormap);
 
-    g_free(self);
+    g_slice_free(ObFrame, self);
 }
 
 void frame_show(ObFrame *self)
index ca64385a249ffefaddae53892939217f2373c343..93a0c7aa6a54aa9e6dc53b0346cf79171c1d3aa0 100644 (file)
@@ -39,7 +39,7 @@ void tree_destroy(KeyBindingTree *tree)
                 actions_act_unref(sit->data);
             g_slist_free(tree->actions);
         }
-        g_free(tree);
+        g_slice_free(KeyBindingTree, tree);
         tree = c;
     }
 }
@@ -56,7 +56,7 @@ KeyBindingTree *tree_build(GList *keylist)
         GList *kit;
 
         p = ret;
-        ret = g_new0(KeyBindingTree, 1);
+        ret = g_slice_new0(KeyBindingTree);
 
         for (kit = it; kit != NULL; kit = g_list_previous(kit))
             ret->keylist = g_list_prepend(ret->keylist,
@@ -87,7 +87,7 @@ void tree_assimilate(KeyBindingTree *node)
             } else {
                 tmp = b;
                 b = b->first_child;
-                g_free(tmp);
+                g_slice_free(KeyBindingTree, tmp);
                 a = a->first_child;
             }
         }
@@ -99,7 +99,7 @@ void tree_assimilate(KeyBindingTree *node)
         } else {
             last->first_child = b->first_child;
             last->first_child->parent = last;
-            g_free(b);
+            g_slice_free(KeyBindingTree, b);
         }
     }
 }
index ac28ade967aef2c45dfe64332c5897d64d35ebee..5a5844bbb7e1de7d2e597b7103086df0d377adec 100644 (file)
@@ -374,7 +374,7 @@ ObMenu* menu_new(const gchar *name, const gchar *title,
 {
     ObMenu *self;
 
-    self = g_new0(ObMenu, 1);
+    self = g_slice_new0(ObMenu);
     self->name = g_strdup(name);
     self->data = data;
 
@@ -393,7 +393,7 @@ ObMenu* menu_new(const gchar *name, const gchar *title,
 
        more_menu->more_menu will always be NULL, since there is only 1 for
        each menu. */
-    self->more_menu = g_new0(ObMenu, 1);
+    self->more_menu = g_slice_new0(ObMenu);
     self->more_menu->name = _("More...");
     self->more_menu->title = _("More...");
     self->more_menu->data = data;
@@ -423,9 +423,9 @@ static void menu_destroy_hash_value(ObMenu *self)
     g_free(self->name);
     g_free(self->title);
     g_free(self->execute);
-    g_free(self->more_menu);
+    g_slice_free(ObMenu, self->more_menu);
 
-    g_free(self);
+    g_slice_free(ObMenu, self);
 }
 
 void menu_free(ObMenu *menu)
@@ -505,7 +505,7 @@ static ObMenuEntry* menu_entry_new(ObMenu *menu, ObMenuEntryType type, gint id)
 
     g_assert(menu);
 
-    self = g_new0(ObMenuEntry, 1);
+    self = g_slice_new0(ObMenuEntry);
     self->ref = 1;
     self->type = type;
     self->menu = menu;
@@ -550,7 +550,7 @@ void menu_entry_unref(ObMenuEntry *self)
             break;
         }
 
-        g_free(self);
+        g_slice_free(ObMenuEntry, self);
     }
 }
 
index d7f09aad0d92b0eaa0006dff5a659912ff992030..85f09519f3a8f91ce9c2c789263323cf66a271f2 100644 (file)
@@ -108,7 +108,7 @@ ObMenuFrame* menu_frame_new(ObMenu *menu, guint show_from, ObClient *client)
     ObMenuFrame *self;
     XSetWindowAttributes attr;
 
-    self = g_new0(ObMenuFrame, 1);
+    self = g_slice_new0(ObMenuFrame);
     self->obwin.type = OB_WINDOW_CLASS_MENUFRAME;
     self->menu = menu;
     self->selected = NULL;
@@ -151,7 +151,7 @@ void menu_frame_free(ObMenuFrame *self)
 
         XDestroyWindow(obt_display, self->window);
 
-        g_free(self);
+        g_slice_free(ObMenuFrame, self);
     }
 }
 
@@ -168,7 +168,7 @@ static ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry,
     ObMenuEntryFrame *self;
     XSetWindowAttributes attr;
 
-    self = g_new0(ObMenuEntryFrame, 1);
+    self = g_slice_new0(ObMenuEntryFrame);
     self->entry = entry;
     self->frame = frame;
 
@@ -216,7 +216,7 @@ static void menu_entry_frame_free(ObMenuEntryFrame *self)
             g_hash_table_remove(menu_frame_map, &self->bullet);
         }
 
-        g_free(self);
+        g_slice_free(ObMenuEntryFrame, self);
     }
 }
 
index ee14935417acf4430b2a40924c7cda53d26f0be9..a7601f69112cf5f2d9b6469dd469245e8860683b 100644 (file)
@@ -155,7 +155,7 @@ void mouse_unbind_all(void)
                     actions_act_unref(jt->data);
                 g_slist_free(b->actions[j]);
             }
-            g_free(b);
+            g_slice_free(ObMouseBinding, b);
         }
         g_slist_free(bound_contexts[i]);
         bound_contexts[i] = NULL;
@@ -390,7 +390,7 @@ gboolean mouse_bind(const gchar *buttonstr, const gchar *contextstr,
     }
 
     /* add the binding */
-    b = g_new0(ObMouseBinding, 1);
+    b = g_slice_new0(ObMouseBinding);
     b->state = state;
     b->button = button;
     b->actions[mact] = g_slist_append(NULL, action);
index b84792940037080cb41d0115ad215ed413452182..bf39a30acfbc9d1fc4733c662d3e9aa5c758f4df 100644 (file)
@@ -75,7 +75,7 @@ void ping_start(struct _ObClient *client, ObPingEventHandler h)
     /* make sure we're not already pinging the client */
     if (g_hash_table_find(ping_ids, find_client, client) != NULL) return;
 
-    t = g_new0(ObPingTarget, 1);
+    t = g_slice_new0(ObPingTarget);
     t->client = client;
     t->h = h;
 
@@ -161,6 +161,6 @@ static void ping_end(ObClient *client, gpointer data)
         obt_main_loop_timeout_remove_data(ob_main_loop, ping_timeout,
                                           t, FALSE);
 
-        g_free(t);
+        g_slice_free(ObPingTarget, t);
     }
 }
index e73545a51b7227850d436de9455b632ac81325c5..6df991a4af0dc9ad72de02c33f2616cd1895dc67 100644 (file)
@@ -152,7 +152,7 @@ ObPrompt* prompt_new(const gchar *msg, const gchar *title,
 
     attrib.override_redirect = FALSE;
 
-    self = g_new0(ObPrompt, 1);
+    self = g_slice_new0(ObPrompt);
     self->ref = 1;
     self->func = func;
     self->cleanup = cleanup;
@@ -250,7 +250,7 @@ void prompt_unref(ObPrompt *self)
 
         XDestroyWindow(obt_display, self->msg.window);
         XDestroyWindow(obt_display, self->super.window);
-        g_free(self);
+        g_slice_free(ObPrompt, self);
     }
 }
 
This page took 0.07469 seconds and 4 git commands to generate.