diff src/paint.c @ 146:e96a584487af

Use elmpool to manage paint_color_t objects. - Add a paint_color_pool member for redraw_man_t. - Initialize and free when redraw_man_init() and redraw_man_destroy().
author Thinker K.F. Li <thinker@branda.to>
date Thu, 25 Sep 2008 09:53:05 +0800
parents 1ca417f741f1
children 995ee8fd5f1a
line wrap: on
line diff
--- a/src/paint.c	Thu Sep 25 02:13:50 2008 +0800
+++ b/src/paint.c	Thu Sep 25 09:53:05 2008 +0800
@@ -13,6 +13,8 @@
     redraw_man_t *rdman;
 } paint_color_t;
 
+int paint_color_size = sizeof(paint_color_t);
+
 
 static void paint_color_prepare(paint_t *paint, cairo_t *cr) {
     paint_color_t *color = (paint_color_t *)paint;
@@ -32,7 +34,7 @@
 			 co_comp_t b, co_comp_t a) {
     paint_color_t *color;
 
-    color = (paint_color_t *)malloc(sizeof(paint_color_t));
+    color = (paint_color_t *)elmpool_elm_alloc(rdman->paint_color_pool);
     if(color == NULL)
 	return NULL;
     color->rdman = rdman;