1. dont free/realoc if no_free is set.
2. free then malloc otherwise realloc might ALSO have to memcpy if it cant resize the segment whihc means overhead we dont need/want. SVN revision: 34441
This commit is contained in:
parent
14e2187305
commit
42facfffe6
|
@ -153,7 +153,14 @@ _evas_common_rgba_image_surface_alloc(Image_Entry *ie, int w, int h)
|
|||
else
|
||||
siz = w * h * sizeof(DATA32);
|
||||
|
||||
im->image.data = realloc(im->image.data, siz);
|
||||
if (im->image.no_free)
|
||||
im->image.data = malloc(siz);
|
||||
else
|
||||
{
|
||||
// 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;
|
||||
|
||||
#ifdef HAVE_VALGRIND
|
||||
|
|
Loading…
Reference in New Issue