diff src/redraw_man.c @ 866:9a7ac4487849

Allocate sh_rect_t objects from an elmpool
author Thinker K.F. Li <thinker@codemud.net>
date Thu, 23 Sep 2010 10:14:05 +0800
parents 48df0f97f09e
children 4f8d53be9488
line wrap: on
line diff
--- a/src/redraw_man.c	Thu Sep 23 09:55:37 2010 +0800
+++ b/src/redraw_man.c	Thu Sep 23 10:14:05 2010 +0800
@@ -640,6 +640,7 @@
 int redraw_man_init(redraw_man_t *rdman, mbe_t *cr, mbe_t *backend) {
     extern void redraw_man_destroy(redraw_man_t *rdman);
     extern int _sh_path_size;
+    extern int _sh_rect_size;
     extern int _paint_color_size;
     observer_t *addrm_ob;
     extern void addrm_monitor_hdlr(event_t *evt, void *arg);
@@ -655,6 +656,7 @@
     rdman->coord_pool = elmpool_new(sizeof(coord_t), 16);
     rdman->shnode_pool = elmpool_new(sizeof(shnode_t), 16);
     rdman->sh_path_pool = elmpool_new(_sh_path_size, 16);
+    rdman->sh_rect_pool = elmpool_new(_sh_rect_size, 16);
     rdman->observer_pool = elmpool_new(sizeof(observer_t), 32);
     rdman->subject_pool = elmpool_new(sizeof(subject_t), 32);
     rdman->paint_color_pool = elmpool_new(_paint_color_size, 64);
@@ -724,6 +726,8 @@
 	elmpool_free(rdman->shnode_pool);
     if(rdman->sh_path_pool)
 	elmpool_free(rdman->sh_path_pool);
+    if(rdman->sh_rect_pool)
+	elmpool_free(rdman->sh_rect_pool);
     if(rdman->observer_pool)
 	elmpool_free(rdman->observer_pool);
     if(rdman->subject_pool)
@@ -784,6 +788,7 @@
     elmpool_free(rdman->geo_pool);
     elmpool_free(rdman->shnode_pool);
     elmpool_free(rdman->sh_path_pool);
+    elmpool_free(rdman->sh_rect_pool);
     elmpool_free(rdman->observer_pool);
     elmpool_free(rdman->subject_pool);
     elmpool_free(rdman->paint_color_pool);