Enlightenment CVS committal Author : cedric Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/common Modified Files: evas_image_main.c Log Message: Only call the allocation surface when required and correctly handle no_free. =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_image_main.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -3 -r1.63 -r1.64 --- evas_image_main.c 3 May 2008 08:31:26 -0000 1.63 +++ evas_image_main.c 6 May 2008 11:20:29 -0000 1.64 @@ -145,29 +145,17 @@ RGBA_Image *im = (RGBA_Image *) ie; size_t siz = 0; -/* if (im->image.data) /\* return 0; *\/ */ -/* free(im->image.data); */ + if (im->image.no_free) return 0; if (im->flags & RGBA_IMAGE_ALPHA_ONLY) siz = w * h * sizeof(DATA8); else siz = w * h * sizeof(DATA32); - /* FIXME: this is wrong. we seem to realloc data here that ismaked "no_free" - * whihc is wrong, but when we fix it, we break all sorts of stuff - * whihc used to work. i suspect the cache changes in evas */ -#if 1 - im->image.data = realloc(im->image.data, siz); + if (im->image.data) free(im->image.data); + im->image.data = malloc(siz); if (im->image.data == NULL) return -1; -#else - if (!im->image.no_free) - { - if (im->image.data) free(im->image.data); - im->image.data = malloc(siz); - if (im->image.data == NULL) return -1; - } -#endif - + #ifdef HAVE_VALGRIND VALGRIND_MAKE_READABLE(im->image.data, siz); #endif @@ -196,7 +184,6 @@ if (im->image.data && !im->image.no_free) free(im->image.data); im->image.data = NULL; - im->image.no_free = 1; } static void ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs