]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
using g_slice_new() instead of g_new() part 1
[chaz/openbox] / openbox / screen.c
index cbcaad798604af9eb61d2a119c3459aa6ea9e222..0bd56591e778d13d7cb09d52ce788773020c3cba 100644 (file)
@@ -1298,11 +1298,14 @@ typedef struct {
 } ObScreenStrut;
 
 #define RESET_STRUT_LIST(sl) \
-    (g_slist_free(sl), sl = NULL)
+    while (sl) { \
+        g_slice_free(ObScreenStrut, (sl)->data); \
+        sl = g_slist_delete_link(sl, sl); \
+    }
 
 #define ADD_STRUT_TO_LIST(sl, d, s) \
 { \
-    ObScreenStrut *ss = g_new(ObScreenStrut, 1); \
+    ObScreenStrut *ss = g_slice_new(ObScreenStrut); \
     ss->desktop = d; \
     ss->strut = s;  \
     sl = g_slist_prepend(sl, ss); \
@@ -1436,7 +1439,7 @@ void screen_update_areas(void)
         dims[i*4+1] = area->y;
         dims[i*4+2] = area->width;
         dims[i*4+3] = area->height;
-        g_free(area);
+        g_slice_free(Rect, area);
     }
 
     /* set the legacy workarea hint to the union of all the monitors */
@@ -1608,7 +1611,7 @@ Rect* screen_area(guint desktop, guint head, Rect *search)
         }
     }
 
-    a = g_new(Rect, 1);
+    a = g_slice_new(Rect);
     a->x = l;
     a->y = t;
     a->width = r - l + 1;
This page took 0.020575 seconds and 4 git commands to generate.