From 4f33c81bdbf94cf15b7cf56fcb05b849f8f99581 Mon Sep 17 00:00:00 2001 From: Cedric Bail Date: Fri, 29 Nov 2013 15:32:27 +0900 Subject: [PATCH] evas: roundup the step size of an array to fit in one page of memory. This make an array stay in 4K instead of 20K before. It should reduce a little bit our peak memory usage without slowing down things to much. --- src/lib/evas/canvas/evas_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c index 185b4a539e..e3f520bf1f 100644 --- a/src/lib/evas/canvas/evas_main.c +++ b/src/lib/evas/canvas/evas_main.c @@ -170,7 +170,8 @@ _constructor(Eo *eo_obj, void *class_data, va_list *list EINA_UNUSED) eina_clist_init(&e->calc_done); #define EVAS_ARRAY_SET(E, Array) \ - eina_array_step_set(&E->Array, sizeof (E->Array), 4096); + eina_array_step_set(&E->Array, sizeof (E->Array), \ + ((1024 * sizeof (void*)) - sizeof (E->Array)) / sizeof (void*)); EVAS_ARRAY_SET(e, delete_objects); EVAS_ARRAY_SET(e, active_objects);