From 1d6a58cfc9f3bbe821eb04150e2b1e0ede7b32eb Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 14 Aug 2016 22:30:32 +0900 Subject: edje - save memory on edje parts as a lot of over-allocation was done so ... Edje_Calc_Params was huge ... like about 200 bytes. every part in every live edje object got one of these in addtion to real part struct info etc. ... so really every part was probably consuming 300-500 bytes or so... crazy. so i made a lot of the data now optional so only the minimum required is allocated now which cuts down about 110 or even 120 bytes per part, depending. 100 bytes was needed for 3d node parts even though almsot no parts are 3d node parts... the image and text data was 30-40 bytes so we consumed 100 even if we only used 30-40... so this cuts that done and puts in polace calc param cleanup funcs everywhere they are needed to clean up this extra allocated data. i also reduced this even more by maping pointers to req_drag, map and physics and clip_to fields in another extension struct cutting down another 28/52 bytes on most parts (in return for an added 4/8 bytes - on 32/64bit accordingly). in elementary_test this saves about ~300kb of ram for just having the etst run and displaying (peak memory measuremment). so massif says 10.6M -> 10.3M. @optimize --- src/lib/edje/edje_embryo.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/lib/edje/edje_embryo.c') diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c index f7eeab68c9..1b899d71e9 100644 --- a/src/lib/edje/edje_embryo.c +++ b/src/lib/edje/edje_embryo.c @@ -2123,11 +2123,6 @@ case EDJE_PART_TYPE_##Short: \ memset(rp->custom, 0, sizeof (Edje_Real_Part_State)); - rp->custom->p.map = eina_cow_alloc(_edje_calc_params_map_cow); -#ifdef HAVE_EPHYSICS - rp->custom->p.physics = eina_cow_alloc(_edje_calc_params_physics_cow); -#endif - *d = *parent; d->state.name = (char *)eina_stringshare_add("custom"); -- cgit v1.2.1