From 5cc3321900ea61a0c3d111204ca07c0ae1b420ed Mon Sep 17 00:00:00 2001 From: raster Date: Sun, 17 Jun 2012 01:32:10 +0000 Subject: [PATCH] adjust default memprool alloc sizes. too big imho. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@72249 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_callbacks.c | 8 ++++---- src/lib/canvas/evas_object_image.c | 2 +- src/lib/canvas/evas_object_line.c | 2 +- src/lib/canvas/evas_object_main.c | 4 ++-- src/lib/canvas/evas_object_polygon.c | 2 +- src/lib/canvas/evas_object_rectangle.c | 2 +- src/lib/canvas/evas_object_smart.c | 4 ++-- src/lib/canvas/evas_object_text.c | 2 +- src/lib/canvas/evas_object_textblock.c | 2 +- src/lib/canvas/evas_object_textgrid.c | 10 ++++++---- 10 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/lib/canvas/evas_callbacks.c b/src/lib/canvas/evas_callbacks.c index 1be0e92..dfd8099 100644 --- a/src/lib/canvas/evas_callbacks.c +++ b/src/lib/canvas/evas_callbacks.c @@ -297,13 +297,13 @@ evas_object_event_callback_priority_add(Evas_Object *obj, Evas_Callback_Type typ if (!obj->callbacks) { - EVAS_MEMPOOL_INIT(_mp_cb, "evas_callbacks", Evas_Callbacks, 512, ); + EVAS_MEMPOOL_INIT(_mp_cb, "evas_callbacks", Evas_Callbacks, 64, ); obj->callbacks = EVAS_MEMPOOL_ALLOC(_mp_cb, Evas_Callbacks); if (!obj->callbacks) return; EVAS_MEMPOOL_PREP(_mp_cb, obj->callbacks, Evas_Callbacks); } - EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 2048, ); + EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 128, ); fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node); if (!fn) return; EVAS_MEMPOOL_PREP(_mp_fn, fn, Evas_Func_Node); @@ -400,13 +400,13 @@ evas_event_callback_priority_add(Evas *e, Evas_Callback_Type type, Evas_Callback if (!e->callbacks) { - EVAS_MEMPOOL_INIT(_mp_cb, "evas_callbacks", Evas_Callbacks, 512, ); + EVAS_MEMPOOL_INIT(_mp_cb, "evas_callbacks", Evas_Callbacks, 64, ); e->callbacks = EVAS_MEMPOOL_ALLOC(_mp_cb, Evas_Callbacks); if (!e->callbacks) return; EVAS_MEMPOOL_PREP(_mp_cb, e->callbacks, Evas_Callbacks); } - EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 2048, ); + EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 128, ); fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node); if (!fn) return; EVAS_MEMPOOL_PREP(_mp_fn, fn, Evas_Func_Node); diff --git a/src/lib/canvas/evas_object_image.c b/src/lib/canvas/evas_object_image.c index 1d974d8..83f385c 100644 --- a/src/lib/canvas/evas_object_image.c +++ b/src/lib/canvas/evas_object_image.c @@ -2679,7 +2679,7 @@ evas_object_image_new(void) Evas_Object_Image *o; /* alloc obj private data */ - EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_image", Evas_Object_Image, 256, NULL); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_image", Evas_Object_Image, 16, NULL); o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Image); if (!o) return NULL; EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Image); diff --git a/src/lib/canvas/evas_object_line.c b/src/lib/canvas/evas_object_line.c index c4725fa..b58fe40 100644 --- a/src/lib/canvas/evas_object_line.c +++ b/src/lib/canvas/evas_object_line.c @@ -222,7 +222,7 @@ evas_object_line_new(void) Evas_Object_Line *o; /* alloc obj private data */ - EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_line", Evas_Object_Line, 16, NULL); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_line", Evas_Object_Line, 4, NULL); o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Line); if (!o) return NULL; EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Line); diff --git a/src/lib/canvas/evas_object_main.c b/src/lib/canvas/evas_object_main.c index 3b2fc80..e0e6f0a 100644 --- a/src/lib/canvas/evas_object_main.c +++ b/src/lib/canvas/evas_object_main.c @@ -17,7 +17,7 @@ evas_object_new(Evas *e __UNUSED__) { Evas_Object *obj; - EVAS_MEMPOOL_INIT(_mp_obj, "evas_object", Evas_Object, 512, NULL); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object", Evas_Object, 32, NULL); obj = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object); if (!obj) return NULL; EVAS_MEMPOOL_PREP(_mp_obj, obj, Evas_Object); @@ -765,7 +765,7 @@ _evas_object_size_hint_alloc(Evas_Object *obj) { if (obj->size_hints) return; - EVAS_MEMPOOL_INIT(_mp_sh, "evas_size_hints", Evas_Size_Hints, 512, ); + EVAS_MEMPOOL_INIT(_mp_sh, "evas_size_hints", Evas_Size_Hints, 32, ); obj->size_hints = EVAS_MEMPOOL_ALLOC(_mp_sh, Evas_Size_Hints); if (!obj->size_hints) return; EVAS_MEMPOOL_PREP(_mp_sh, obj->size_hints, Evas_Size_Hints); diff --git a/src/lib/canvas/evas_object_polygon.c b/src/lib/canvas/evas_object_polygon.c index 41655c3..0bb740a 100644 --- a/src/lib/canvas/evas_object_polygon.c +++ b/src/lib/canvas/evas_object_polygon.c @@ -261,7 +261,7 @@ evas_object_polygon_new(void) Evas_Object_Polygon *o; /* alloc obj private data */ - EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_polygon", Evas_Object_Polygon, 32, NULL); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_polygon", Evas_Object_Polygon, 4, NULL); o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Polygon); if (!o) return NULL; EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Polygon); diff --git a/src/lib/canvas/evas_object_rectangle.c b/src/lib/canvas/evas_object_rectangle.c index a7ccf14..da38342 100644 --- a/src/lib/canvas/evas_object_rectangle.c +++ b/src/lib/canvas/evas_object_rectangle.c @@ -114,7 +114,7 @@ evas_object_rectangle_new(void) Evas_Object_Rectangle *o; /* alloc obj private data */ - EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_rectangle", Evas_Object_Rectangle, 256, NULL); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_rectangle", Evas_Object_Rectangle, 16, NULL); o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Rectangle); if (!o) return NULL; EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Rectangle); diff --git a/src/lib/canvas/evas_object_smart.c b/src/lib/canvas/evas_object_smart.c index 0c39b28..83b4e88 100644 --- a/src/lib/canvas/evas_object_smart.c +++ b/src/lib/canvas/evas_object_smart.c @@ -371,7 +371,7 @@ evas_object_smart_callback_priority_add(Evas_Object *obj, const char *event, Eva MAGIC_CHECK_END(); if (!event) return; if (!func) return; - EVAS_MEMPOOL_INIT(_mp_cb, "evas_smart_callback", Evas_Smart_Callback, 512, ); + EVAS_MEMPOOL_INIT(_mp_cb, "evas_smart_callback", Evas_Smart_Callback, 32, ); cb = EVAS_MEMPOOL_ALLOC(_mp_cb, Evas_Smart_Callback); if (!cb) return; EVAS_MEMPOOL_PREP(_mp_cb, cb, Evas_Smart_Callback); @@ -975,7 +975,7 @@ evas_object_smart_new(void) Evas_Object_Smart *o; /* alloc obj private data */ - EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_smart", Evas_Object_Smart, 256, NULL); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_smart", Evas_Object_Smart, 32, NULL); o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Smart); if (!o) return NULL; EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Smart); diff --git a/src/lib/canvas/evas_object_text.c b/src/lib/canvas/evas_object_text.c index 03cfc9a..606496d 100644 --- a/src/lib/canvas/evas_object_text.c +++ b/src/lib/canvas/evas_object_text.c @@ -1387,7 +1387,7 @@ evas_object_text_new(void) Evas_Object_Text *o; /* alloc obj private data */ - EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_text", Evas_Object_Text, 128, NULL); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_text", Evas_Object_Text, 8, NULL); o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Text); if (!o) return NULL; EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Text); diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index 8272344..3f8a2c8 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -9339,7 +9339,7 @@ evas_object_textblock_new(void) Evas_Object_Textblock *o; /* alloc obj private data */ - EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_textblock", Evas_Object_Textblock, 64, NULL); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_textblock", Evas_Object_Textblock, 8, NULL); o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Textblock); if (!o) return NULL; EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Textblock); diff --git a/src/lib/canvas/evas_object_textgrid.c b/src/lib/canvas/evas_object_textgrid.c index 7e1b4b5..ef8a370 100644 --- a/src/lib/canvas/evas_object_textgrid.c +++ b/src/lib/canvas/evas_object_textgrid.c @@ -125,6 +125,8 @@ static const Evas_Object_Func object_func = NULL }; +EVAS_MEMPOOL(_mp_obj); + /* all nice and private */ static void evas_object_textgrid_init(Evas_Object *obj) @@ -154,9 +156,9 @@ evas_object_textgrid_new(void) Evas_Object_Textgrid *o; /* FIXME: using evas mempool like text ? */ - - /* alloc obj private data */ - o = calloc(1, sizeof(Evas_Object_Textgrid)); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_textgrid", Evas_Object_Textgrid, 4, NULL); + o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Textgrid); + EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Textgrid); o->magic = MAGIC_OBJ_TEXTGRID; o->prev = o->cur; o->cur.palette_standard = eina_array_new(16); @@ -238,7 +240,7 @@ evas_object_textgrid_free(Evas_Object *obj) eina_array_free(o->cur.palette_extended); o->magic = 0; /* FIXME: using evas mempool like text ? */ - free(o); + EVAS_MEMPOOL_FREE(_mp_obj, o); } -- 2.7.4