Mercurial > MadButterfly
comparison src/redraw_man.c @ 865:48df0f97f09e
Allocate sh_path_t objects from an elmpool
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Thu, 23 Sep 2010 09:55:37 +0800 |
parents | 6eaeec6806f2 |
children | 9a7ac4487849 |
comparison
equal
deleted
inserted
replaced
864:6eaeec6806f2 | 865:48df0f97f09e |
---|---|
637 static void mouse_event_root_dummy(event_t *evt, void *arg) { | 637 static void mouse_event_root_dummy(event_t *evt, void *arg) { |
638 } | 638 } |
639 | 639 |
640 int redraw_man_init(redraw_man_t *rdman, mbe_t *cr, mbe_t *backend) { | 640 int redraw_man_init(redraw_man_t *rdman, mbe_t *cr, mbe_t *backend) { |
641 extern void redraw_man_destroy(redraw_man_t *rdman); | 641 extern void redraw_man_destroy(redraw_man_t *rdman); |
642 extern int _sh_path_size; | |
642 extern int _paint_color_size; | 643 extern int _paint_color_size; |
643 observer_t *addrm_ob; | 644 observer_t *addrm_ob; |
644 extern void addrm_monitor_hdlr(event_t *evt, void *arg); | 645 extern void addrm_monitor_hdlr(event_t *evt, void *arg); |
645 | 646 |
646 memset(rdman, 0, sizeof(redraw_man_t)); | 647 memset(rdman, 0, sizeof(redraw_man_t)); |
651 DARRAY_INIT(&rdman->zeroing_coords); | 652 DARRAY_INIT(&rdman->zeroing_coords); |
652 | 653 |
653 rdman->geo_pool = elmpool_new(sizeof(geo_t), 128); | 654 rdman->geo_pool = elmpool_new(sizeof(geo_t), 128); |
654 rdman->coord_pool = elmpool_new(sizeof(coord_t), 16); | 655 rdman->coord_pool = elmpool_new(sizeof(coord_t), 16); |
655 rdman->shnode_pool = elmpool_new(sizeof(shnode_t), 16); | 656 rdman->shnode_pool = elmpool_new(sizeof(shnode_t), 16); |
657 rdman->sh_path_pool = elmpool_new(_sh_path_size, 16); | |
656 rdman->observer_pool = elmpool_new(sizeof(observer_t), 32); | 658 rdman->observer_pool = elmpool_new(sizeof(observer_t), 32); |
657 rdman->subject_pool = elmpool_new(sizeof(subject_t), 32); | 659 rdman->subject_pool = elmpool_new(sizeof(subject_t), 32); |
658 rdman->paint_color_pool = elmpool_new(_paint_color_size, 64); | 660 rdman->paint_color_pool = elmpool_new(_paint_color_size, 64); |
659 rdman->pent_pool = elmpool_new(sizeof(mb_prop_entry_t), 128); | 661 rdman->pent_pool = elmpool_new(sizeof(mb_prop_entry_t), 128); |
660 rdman->coord_canvas_pool = elmpool_new(sizeof(coord_canvas_info_t), 16); | 662 rdman->coord_canvas_pool = elmpool_new(sizeof(coord_canvas_info_t), 16); |
718 elmpool_free(rdman->geo_pool); | 720 elmpool_free(rdman->geo_pool); |
719 if(rdman->coord_pool) | 721 if(rdman->coord_pool) |
720 elmpool_free(rdman->coord_pool); | 722 elmpool_free(rdman->coord_pool); |
721 if(rdman->shnode_pool) | 723 if(rdman->shnode_pool) |
722 elmpool_free(rdman->shnode_pool); | 724 elmpool_free(rdman->shnode_pool); |
725 if(rdman->sh_path_pool) | |
726 elmpool_free(rdman->sh_path_pool); | |
723 if(rdman->observer_pool) | 727 if(rdman->observer_pool) |
724 elmpool_free(rdman->observer_pool); | 728 elmpool_free(rdman->observer_pool); |
725 if(rdman->subject_pool) | 729 if(rdman->subject_pool) |
726 elmpool_free(rdman->subject_pool); | 730 elmpool_free(rdman->subject_pool); |
727 if(rdman->paint_color_pool) | 731 if(rdman->paint_color_pool) |
777 */ | 781 */ |
778 | 782 |
779 elmpool_free(rdman->coord_pool); | 783 elmpool_free(rdman->coord_pool); |
780 elmpool_free(rdman->geo_pool); | 784 elmpool_free(rdman->geo_pool); |
781 elmpool_free(rdman->shnode_pool); | 785 elmpool_free(rdman->shnode_pool); |
786 elmpool_free(rdman->sh_path_pool); | |
782 elmpool_free(rdman->observer_pool); | 787 elmpool_free(rdman->observer_pool); |
783 elmpool_free(rdman->subject_pool); | 788 elmpool_free(rdman->subject_pool); |
784 elmpool_free(rdman->paint_color_pool); | 789 elmpool_free(rdman->paint_color_pool); |
785 elmpool_free(rdman->pent_pool); | 790 elmpool_free(rdman->pent_pool); |
786 elmpool_free(rdman->coord_canvas_pool); | 791 elmpool_free(rdman->coord_canvas_pool); |